Skip to content

Commit 9ce2254

Browse files
various documentation improvements
1 parent 7dd2b59 commit 9ce2254

13 files changed

+133
-151
lines changed

doc/python/2D-Histogram.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fig.show()
9696

9797
### 2D Histograms with Graph Objects
9898

99-
To build this kind of plot without using Plotly Express, we can use the `go.Histogram2d` class.
99+
To build this kind of figure using [graph objects](/python/graph-objects/) without using Plotly Express, we can use the `go.Histogram2d` class.
100100

101101

102102
### 2D Histogram of a Bivariate Normal Distribution ###
@@ -236,4 +236,4 @@ fig.show()
236236
```
237237

238238
#### Reference
239-
See https://plotly.com/python/reference/#histogram2d for more information and chart attribute options!
239+
See https://plotly.com/python/reference/#histogram2d for more information and chart attribute options!

doc/python/2d-histogram-contour.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fig.show()
9595

9696
### 2D Histograms with Graph Objects
9797

98-
To build this kind of plot without using Plotly Express, we can use the `go.Histogram2d` class.
98+
To build this kind of figure with [graph objects](/python/graph-objects/) without using Plotly Express, we can use the `go.Histogram2d` class.
9999

100100
#### Basic 2D Histogram Contour
101101

@@ -249,4 +249,4 @@ fig.show()
249249
```
250250

251251
#### Reference
252-
See https://plotly.com/python/reference/#histogram2dcontour for more information and chart attribute options!
252+
See https://plotly.com/python/reference/#histogram2dcontour for more information and chart attribute options!

doc/python/animations.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jupyter:
2525

2626
#### Animated figures with Plotly Express
2727

28-
Several Plotly Express functions support the creation of animated figures through the `animation_frame` and `animation_group` arguments.
28+
Several [Plotly Express](/python/plotly-express/) functions support the creation of animated figures through the `animation_frame` and `animation_group` arguments.
2929

3030
Here is an example of an animated scatter plot creating using Plotly Express. Note that you should always fix the `x_range` and `y_range` to ensure that your data remains visible throughout the animation.
3131

@@ -54,12 +54,12 @@ fig.show()
5454
### Current Animation Limitations and Caveats
5555

5656
* Animations are designed to work well when each row of input is present across all animation frames, and when categorical values mapped to symbol, color and facet are constant across frames. Animations *may be misleading or inconsistent* if these constraints are not met.
57-
* Although Plotly Express supports animation for many chart and map types, smooth inter-frame transitions are today only possible for scatter and bar
58-
* Plotly Express will not automatically compute the union of all x/y/color ranges, so these must be specified manually to avoid scale jumps across frames
57+
* Although Plotly Express supports animation for many chart and map types, smooth inter-frame transitions are today *only* possible for `scatter` and `bar`
58+
* Plotly Express will *not* automatically compute the union of all x/y/color ranges, so these must be specified manually to avoid scale jumps across frames
5959

6060
#### Animated figures with Graph Objects
6161

62-
The remainder of this section describes the low-level API for constructing animated figures manually.
62+
The remainder of this section describes the low-level [graph objects](/python/graph-objects/) API for constructing animated figures manually.
6363

6464
#### Frames
6565

doc/python/bubble-maps.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jupyter:
3535

3636
#### Base Map Configuration
3737

38-
Plotly figures made with `px.scatter_geo`, `px.line_geo` or `px.choropleth` functions or containing `go.Choropleth` or `go.Scattergeo` graph objects have a `go.layout.Geo` object which can be used to [control the appearance of the base map](/python/map-configuration/) onto which data is plotted.
38+
Plotly figures made with [Plotly Express](/python/plotly-express/) `px.scatter_geo`, `px.line_geo` or `px.choropleth` functions or containing `go.Choropleth` or `go.Scattergeo` [graph objects](/python/graph-objects/) have a `go.layout.Geo` object which can be used to [control the appearance of the base map](/python/map-configuration/) onto which data is plotted.
3939

4040
### Bubble map with Plotly Express
4141

@@ -208,4 +208,4 @@ fig.show()
208208

209209
#### Reference
210210

211-
See https://plotly.com/python/reference/#choropleth and https://plotly.com/python/reference/#scattergeo for more information and chart attribute options!
211+
See https://plotly.com/python/reference/#choropleth and https://plotly.com/python/reference/#scattergeo for more information and chart attribute options!

doc/python/choropleth-maps.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Below we show how to create Choropleth Maps using either Plotly Express' `px.cho
3939

4040
#### Base Map Configuration
4141

42-
Plotly figures made with `px.scatter_geo`, `px.line_geo` or `px.choropleth` functions or containing `go.Choropleth` or `go.Scattergeo` graph objects have a `go.layout.Geo` object which can be used to [control the appearance of the base map](/python/map-configuration/) onto which data is plotted.
42+
Plotly figures made with [Plotly Express](/python/plotly-express/) `px.scatter_geo`, `px.line_geo` or `px.choropleth` functions or containing `go.Choropleth` or `go.Scattergeo` [graph objects](/python/graph-objects/) have a `go.layout.Geo` object which can be used to [control the appearance of the base map](/python/map-configuration/) onto which data is plotted.
4343

4444
### Introduction: main parameters for choropleth outline maps
4545

@@ -347,4 +347,4 @@ fig.show()
347347

348348
#### Reference
349349

350-
See https://plotly.com/python/reference/#choropleth for more information and chart attribute options!
350+
See https://plotly.com/python/reference/#choropleth for more information and chart attribute options!

doc/python/colorscales.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ This document explains the following four continuous-color-related concepts:
5252

5353
### Continuous Color with Plotly Express
5454

55-
Most Plotly Express functions accept a `color` argument which automatically assigns data values to continuous color **if the data is numeric**. If the data contains strings, the color will automatically be considered [discrete (also known as categorical or qualitative)](/python/discrete-color/). This means that numeric strings must be parsed to be used for continuous color, and conversely, numbers used as category codes must be converted to strings.
55+
Most [Plotly Express](/python/plotly-express/) functions accept a `color` argument which automatically assigns data values to continuous color **if the data is numeric**. If the data contains strings, the color will automatically be considered [discrete (also known as categorical or qualitative)](/python/discrete-color/). This means that numeric strings must be parsed to be used for continuous color, and conversely, numbers used as category codes must be converted to strings.
5656

5757
For example, in the `tips` dataset, the `size` column contains numbers:
5858

@@ -92,7 +92,7 @@ fig.show()
9292

9393
### Color Scales in Plotly Express
9494

95-
By default, Plotly Express will use the color scale from the active [template](/python/templates/)'s `layout.colorscales.sequential` attribute, and the default active template is `plotly` which uses the `Plasma` color scale. You can choose any of the [built-in color scales](/python/builtin-colorscales/), however, or define your own.
95+
By default, [Plotly Express](/python/plotly-express/) will use the color scale from the active [template](/python/templates/)'s `layout.colorscales.sequential` attribute, and the default active template is `plotly` which uses the `Plasma` color scale. You can choose any of the [built-in color scales](/python/builtin-colorscales/), however, or define your own.
9696

9797
Here is an example that creates a scatter plot using Plotly Express, with points colored using the Viridis color scale.
9898

@@ -557,4 +557,4 @@ fig.show()
557557

558558
### Reference
559559

560-
See https://plotly.com/python/reference/ for more information and chart attribute options!
560+
See https://plotly.com/python/reference/ for more information and chart attribute options!

doc/python/figure-structure.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ At [render-time](/python/renderers/), it is also possible to control certain fig
101101

102102
Various figure components configured within the layout of the figure support positioning attributes named `x` or `y`, whose values may be specified in "paper coordinates" (sometimes referred to as "plot fractions" or "normalized coordinates"). Examples include `layout.xaxis.domain` or `layout.legend.x` or `layout.annotation[].x`.
103103

104-
Positioning in paper coordinates is not done in absolute pixel terms, but rather in terms relative to a coordinate system defined with an origin `(0,0)` at `(layout.margin.l, layout.margin.b)` and a point `(1,1)` at `(layout.width-layout.margin.r, layout.height-layout.margin.t)`. Values less than 0 or greater than 1 are permitted, and refer to areas within the plot margins.
104+
Positioning in paper coordinates is *not* done in absolute pixel terms, but rather in terms relative to a coordinate system defined with an origin `(0,0)` at `(layout.margin.l, layout.margin.b)` and a point `(1,1)` at `(layout.width-layout.margin.r, layout.height-layout.margin.t)` (note: `layout.margin` values are pixel values, as are `layout.width` and `layout.height`). Paper coordinate values less than 0 or greater than 1 are permitted, and refer to areas within the plot margins.
105105

106-
Note that the contents of the `layout.margin` attribute are by default computed based on the position and dimensions of certain items like the title or legend, and may be made dependent on the position and dimensions of tick labels as well when setting the `layout.xaxis.automargin` attribute to `True`. This has the effect of automatically increasing the margin values and therefore shrinking the physical area defined between the `(0,0)` and `(1,1)` points. Positioning certain items at paper coordinates less than 0 or greater than 1 will also trigger this behavior.
106+
Note that the contents of the `layout.margin` attribute are by default computed based on the position and dimensions of certain items like the title or legend, and may be made dependent on the position and dimensions of tick labels as well when setting the `layout.xaxis.automargin` attribute to `True`. This has the effect of automatically increasing the margin values and therefore shrinking the physical area defined between the `(0,0)` and `(1,1)` points. Positioning certain items at paper coordinates less than 0 or greater than 1 will also trigger this behavior. The `layout.width` and `layout.height`, however, are taken as givens, so a figure will never grow or shrink based on its contents.
107107

108108
The figure title may be positioned using "container coordinates" which have `(0,0)` and `(1,1)` anchored at the bottom-left and top-right of the figure, respectively, and therefore are independent of the values of layout.margin.
109109

@@ -184,8 +184,12 @@ The following trace types are compatible with `carpet` trace subplots via the `c
184184

185185
### Trace Types, Legends and Color Bars
186186

187-
Traces of most types can be optionally associated with a single legend item in the [legend](/python/legend/), which can be shown via the `showlegend` attribute. Traces which are their own subplots (see above) do not support this, with the exception of traces of type `pie` and `funnelarea` for which every distinct color represented in the trace gets a separate legend item. Users may show or hide traces by clicking or double-clicking on their associated legend item. Traces that support legend items also support the `legendgroup` attribute, and all traces with the same legend group are treated the same way during click/double-click interactions.
187+
Traces of most types can be optionally associated with a single legend item in the [legend](/python/legend/). Whether or not a given trace appears in the legend is controlled via the `showlegend` attribute. Traces which are their own subplots (see above) do not support this, with the exception of traces of type `pie` and `funnelarea` for which every distinct color represented in the trace gets a separate legend item. Users may show or hide traces by clicking or double-clicking on their associated legend item. Traces that support legend items also support the `legendgroup` attribute, and all traces with the same legend group are treated the same way during click/double-click interactions.
188188

189189
The fact that legend items are linked to traces means that when using [discrete color](/python/discrete-color/), a figure must have one trace per color in order to get a meaningful legend. [Plotly Express has robust support for discrete color](/python/discrete-color/) to make this easy.
190190

191-
Traces which support [continuous color](/python/colorscales/) can also be associated with color axes in the layout via the `coloraxis` attribute. Multiple traces can be linked to the same color axis. Color axes have a legend-like component called color bars. Alternatively, color axes can be configured within the trace itself.
191+
Traces which support [continuous color](/python/colorscales/) can also be associated with color axes in the layout via the `coloraxis` attribute. Multiple traces can be linked to the same color axis. Color axes have a legend-like component called color bars. Alternatively, color axes can be configured within the trace itself.
192+
193+
```python
194+
195+
```

0 commit comments

Comments
 (0)