Skip to content

Commit b05493d

Browse files
merge doc-prod to master
2 parents eeb774d + b095f89 commit b05493d

File tree

8 files changed

+37
-109
lines changed

8 files changed

+37
-109
lines changed

Diff for: .circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ jobs:
400400
. venv/bin/activate
401401
npm install [email protected]
402402
npm install orca
403+
pip uninstall -y plotly
403404
pip install -r requirements.txt
404405
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
405406
pip uninstall -y plotly

Diff for: doc/README.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
## Introduction: structure and required packages
44

5-
The `doc` directory contains the source files of the documentation of plotly.py.
5+
The `doc` directory contains the source files of the documentation of plotly.py.
66
It is composed of two parts:
77

88
- inside the [`python/` directory](python), tutorials corresponding to https://plot.ly/python/
99
- inside the [`apidoc/` directory](apidoc), configuration files for generating
1010
the API reference documentation (hosted on https://plot.ly/python-api-reference/)
1111

1212
Python packages required to build the doc are listed in
13-
[`requirements.txt`](requirements.txt) in the `doc` directory.
13+
[`requirements.txt`](requirements.txt) in the `doc` directory.
1414

1515
## Tutorials (`python` directory)
1616

@@ -21,15 +21,15 @@ For small edits (e.g., correcting typos) to an existing tutorial, you can simply
2121
page on Github" link at the top right of the page (e.g. clicking on this link
2222
on https://plot.ly/python/bar-charts/ will take you to
2323
https://github.com/plotly/plotly.py/edit/doc-prod/doc/python/bar-charts.md,
24-
where you can edit the page on Github).
24+
where you can edit the page on Github).
2525

2626
For more important edits where you need to run the notebook to check the output,
2727
clone the repository and setup an environment as described in the [main
2828
contributing notes](../contributing.md). If you're writing documentation at the
2929
same time as you are developing a feature, make sure to install with editable
30-
install (`pip install -e`, as described in [main
30+
install (`pip install -e`, as described in [main
3131
contributing notes](../contributing.md)), so that you only need to restart
32-
the Jupyter kernel when you have changed the source code of the feature.
32+
the Jupyter kernel when you have changed the source code of the feature.
3333

3434
### Branches
3535

@@ -48,7 +48,7 @@ released, or which has just been included but not yet released.
4848
### Guidelines
4949

5050
We try to write short, standalone and (almost) self-explaining examples. Most
51-
examples should focus on a single feature.
51+
examples should focus on a single feature.
5252

5353
Checklist
5454

@@ -81,17 +81,15 @@ in order to generate the documentation of the API. Sphinx uses the [reST markup
8181
language](https://www.sphinx-doc.org/en/2.0/usage/restructuredtext/basics.html).
8282

8383
Run `make html` inside `apidoc` to build the API doc in the `_build/html`
84-
directory.
84+
directory.
8585

8686
Lists of objects to be documented are found in files corresponding to
8787
submodules, such as [`plotly.express.rst`](plotly.express.rst). When a new
8888
object is added to the exposed API, it needs to be added to the corresponding
89-
file to appear in the API doc.
89+
file to appear in the API doc.
9090

9191
Other files
9292

9393
- `css` files are found in `_static`
9494
- Template files are found in `_templates`. `.rst` templates describe how the
95-
autodoc of the different objects should look like.
96-
97-
95+
autodoc of the different objects should look like.

Diff for: doc/python/horizontal-legend.md

-77
This file was deleted.

Diff for: doc/python/legend.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.2'
8+
format_version: "1.2"
99
jupytext_version: 1.3.0
1010
kernelspec:
1111
display_name: Python 3
@@ -29,10 +29,12 @@ jupyter:
2929
name: Legends
3030
order: 14
3131
permalink: python/legend/
32+
redirect_from: python/horizontal-legend/
3233
thumbnail: thumbnail/legends.gif
3334
---
3435

3536
#### Show Legend
37+
3638
By default the legend is displayed on Plotly charts with multiple traces.
3739

3840
```python
@@ -240,9 +242,11 @@ fig.update_layout(
240242

241243
fig.show()
242244
```
245+
243246
### Size of Legend Items
244247

245-
In this example [itemsizing](https://plot.ly/python/reference/#layout-legend-itemsizing) attribute determines the legend items symbols remain constant, regardless of how tiny/huge the bubbles would be in the graph.
248+
In this example [itemsizing](https://plot.ly/python/reference/#layout-legend-itemsizing) attribute determines the legend items symbols remain constant, regardless of how tiny/huge the bubbles would be in the graph.
249+
246250
```python
247251
import plotly.graph_objects as go
248252

@@ -266,6 +270,7 @@ fig.update_layout(legend= {'itemsizing': 'constant'})
266270

267271
fig.show()
268272
```
273+
269274
#### Grouped Legend
270275

271276
```python
@@ -364,7 +369,7 @@ fig.show()
364369

365370
Traces corresponding to 2D fields (e.g. `go.Heatmap`, `go.Histogram2d`) or 3D fields (e.g. `go.Isosurface`, `go.Volume`, `go.Cone`) can also appear in the legend. They come with legend icons corresponding to each trace type, which are colored using the same colorscale as the trace.
366371

367-
The example below explores a vector field using several traces. Note that you can click on legend items to hide or to select (with a double click) a specific trace. This will make the exploration of your data easier!
372+
The example below explores a vector field using several traces. Note that you can click on legend items to hide or to select (with a double click) a specific trace. This will make the exploration of your data easier!
368373

369374
```python
370375
import numpy as np
@@ -382,18 +387,18 @@ mask2 = y>.6
382387
fig = go.Figure(go.Isosurface(
383388
x=x.ravel(), y=y.ravel(), z=z.ravel(),
384389
value=magnitude.ravel(),
385-
isomin=1.9, isomax=1.9,
390+
isomin=1.9, isomax=1.9,
386391
colorscale="BuGn",
387392
name='isosurface'))
388393

389394

390-
fig.add_trace(go.Cone(x=x[mask1], y=y[mask1], z=z[mask1],
395+
fig.add_trace(go.Cone(x=x[mask1], y=y[mask1], z=z[mask1],
391396
u=u[mask1], v=v[mask1], w=w[mask1],
392397
colorscale="Blues",
393398
name='cones'
394399
))
395400
fig.add_trace(go.Streamtube(
396-
x=x[mask2], y=y[mask2], z=z[mask2],
401+
x=x[mask2], y=y[mask2], z=z[mask2],
397402
u=u[mask2], v=v[mask2], w=w[mask2],
398403
colorscale="Reds",
399404
name='streamtubes'
@@ -405,4 +410,5 @@ fig.show()
405410
```
406411

407412
#### Reference
413+
408414
See https://plot.ly/python/reference/#layout-legend for more information!

Diff for: doc/python/peak-finding.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
8+
format_version: "1.1"
99
jupytext_version: 1.1.1
1010
kernelspec:
1111
display_name: Python 3
@@ -23,7 +23,7 @@ jupyter:
2323
version: 3.6.7
2424
plotly:
2525
description: Learn how to find peaks and valleys on datasets in Python
26-
display_as: peak-analysis
26+
display_as: advanced_opt
2727
has_thumbnail: false
2828
language: python
2929
layout: base
@@ -35,6 +35,7 @@ jupyter:
3535
---
3636

3737
#### Imports
38+
3839
The tutorial below imports [Pandas](https://plot.ly/pandas/intro-to-pandas-tutorial/), and [SciPy](https://www.scipy.org/).
3940

4041
```python
@@ -43,6 +44,7 @@ from scipy.signal import find_peaks
4344
```
4445

4546
#### Import Data
47+
4648
To start detecting peaks, we will import some data on milk production by month:
4749

4850
```python
@@ -97,6 +99,7 @@ fig.show()
9799
```
98100

99101
#### Only Highest Peaks
102+
100103
We can attempt to set our threshold so that we identify as many of the _highest peaks_ that we can.
101104

102105
```python

Diff for: doc/python/plot-data-from-csv.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
8+
format_version: "1.1"
99
jupytext_version: 1.2.0
1010
kernelspec:
1111
display_name: Python 3
@@ -23,7 +23,7 @@ jupyter:
2323
version: 3.6.8
2424
plotly:
2525
description: How to create charts from csv files with Plotly and Python
26-
display_as: databases
26+
display_as: advanced_opt
2727
has_thumbnail: false
2828
language: python
2929
layout: base
@@ -34,7 +34,6 @@ jupyter:
3434
thumbnail: thumbnail/csv.jpg
3535
---
3636

37-
3837
CSV or comma-delimited-values is a very popular format for storing structured data. In this tutorial, we will see how to plot beautiful graphs using csv data, and Pandas. We will learn how to import csv data from an external source (a url), and plot it using Plotly and pandas.
3938

4039
First we import the data and look at it.
@@ -57,7 +56,6 @@ fig = px.line(df, x = 'AAPL_x', y = 'AAPL_y', title='Apple Share Prices over tim
5756
fig.show()
5857
```
5958

60-
6159
### Plot from CSV with `graph_objects`
6260

6361
```python
@@ -76,6 +74,6 @@ fig.update_layout(title='Apple Share Prices over time (2014)',
7674
fig.show()
7775
```
7876

79-
8077
#### Reference
78+
8179
See https://plot.ly/python/getting-started for more information about Plotly's Python API!

Diff for: doc/python/random-walk.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
8+
format_version: "1.1"
99
jupytext_version: 1.1.1
1010
kernelspec:
1111
display_name: Python 3
@@ -23,7 +23,7 @@ jupyter:
2323
version: 3.6.7
2424
plotly:
2525
description: Learn how to use Python to make a Random Walk
26-
display_as: statistics
26+
display_as: advanced_opt
2727
has_thumbnail: false
2828
language: python
2929
layout: base
@@ -36,10 +36,8 @@ jupyter:
3636

3737
A [random walk](https://en.wikipedia.org/wiki/Random_walk) can be thought of as a random process in which a token or a marker is randomly moved around some space, that is, a space with a metric used to compute distance. It is more commonly conceptualized in one dimension ($\mathbb{Z}$), two dimensions ($\mathbb{Z}^2$) or three dimensions ($\mathbb{Z}^3$) in Cartesian space, where $\mathbb{Z}$ represents the set of integers. In the visualizations below, we will be using [scatter plots](https://plot.ly/python/line-and-scatter/) as well as a colorscale to denote the time sequence of the walk.
3838

39-
4039
#### Random Walk in 1D
4140

42-
4341
The jitter in the data points along the x and y axes are meant to illuminate where the points are being drawn and what the tendancy of the random walk is.
4442

4543
```python
@@ -137,6 +135,7 @@ fig.show()
137135
```
138136

139137
#### Advanced Tip
138+
140139
We can formally think of a 1D random walk as a point jumping along the integer number line. Let $Z_i$ be a random variable that takes on the values +1 and -1. Let this random variable represent the steps we take in the random walk in 1D (where +1 means right and -1 means left). Also, as with the above visualizations, let us assume that the probability of moving left and right is just $\frac{1}{2}$. Then, consider the sum
141140

142141
$$
@@ -164,4 +163,3 @@ $$
164163
$$
165164

166165
Therefore, we expect our random walk to hover around $0$ regardless of how many steps we take in our walk.
167-

Diff for: doc/python/smoothing.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
8+
format_version: "1.1"
99
jupytext_version: 1.1.1
1010
kernelspec:
1111
display_name: Python 3
@@ -23,7 +23,7 @@ jupyter:
2323
version: 3.6.7
2424
plotly:
2525
description: Learn how to perform smoothing using various methods in Python.
26-
display_as: signal-analysis
26+
display_as: advanced_opt
2727
has_thumbnail: false
2828
language: python
2929
layout: base
@@ -34,8 +34,8 @@ jupyter:
3434
thumbnail: /images/static-image
3535
---
3636

37-
3837
#### Imports
38+
3939
The tutorial below imports [NumPy](http://www.numpy.org/), [Pandas](https://plot.ly/pandas/intro-to-pandas-tutorial/), [SciPy](https://www.scipy.org/) and [Plotly](https://plot.ly/python/getting-started/).
4040

4141
```python
@@ -49,6 +49,7 @@ from scipy import signal
4949
```
5050

5151
#### Savitzky-Golay Filter
52+
5253
`Smoothing` is a technique that is used to eliminate noise from a dataset. There are many algorithms and methods to accomplish this but all have the same general purpose of 'roughing out the edges' or 'smoothing' some data.
5354

5455
There is reason to smooth data if there is little to no small-scale structure in the data. The danger to this thinking is that one may skew the representation of the data enough to change its percieved meaning, so for the sake of scientific honesty it is an imperative to at the very minimum explain one's reason's for using a smoothing algorithm to their dataset.

0 commit comments

Comments
 (0)