diff --git a/python/axes.md b/python/axes.md index ecc6d058e..9969f16b0 100644 --- a/python/axes.md +++ b/python/axes.md @@ -34,6 +34,8 @@ jupyter: thumbnail: thumbnail/axes.png --- +**See also** the tutorials on [subplots](/python/subplots) and [multiple axes](/python/multiple-axes/). + #### Toggling Axes Lines, Ticks, Labels, and Autorange ##### Toggling Axis grid lines Axis grid lines can be disabled by setting the `showgrid` property to `False` for the x and/or y axis. diff --git a/python/creating-and-updating-figures.md b/python/creating-and-updating-figures.md index e654d52a4..0331d5f30 100644 --- a/python/creating-and-updating-figures.md +++ b/python/creating-and-updating-figures.md @@ -487,6 +487,10 @@ fig.show() There are also `for_each_xaxis` and `for_each_yaxis` methods that are analogous to the `for_each_trace` method described above. For non-cartesian subplot types (e.g. polar), there are additional `update_{type}` and `for_each_{type}` methods (e.g. `update_polar`, `for_each_polar`). +### Other update methods + +`go` figures also support `update_layout_images` in order to [update background layout images](/python/images/), `update_annotations` in order to [update annotations](/python/text-and-annotations/#multiple-annotations), and `update-shapes` in order to [update shapes](/python/shapes/). + #### Chaining figure operations All of the figure update operations described above are methods that return a reference to the figure being modified. This makes it possible the chain multiple figure modification operations together into a single expression. diff --git a/python/histograms.md b/python/histograms.md index d133c219e..5bb3c8da3 100644 --- a/python/histograms.md +++ b/python/histograms.md @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.6.7 + version: 3.7.3 plotly: description: How to make Histograms in Python with Plotly. display_as: statistical @@ -34,9 +34,13 @@ jupyter: thumbnail: thumbnail/histogram.jpg --- +In statistics, a [histogram](https://en.wikipedia.org/wiki/Histogram) is representation of the distribution of numerical data, where the data are binned and the count for each bin is represented. More generally, in plotly a histogram is an aggregated bar chart, with several possible aggregation functions (e.g. sum, average, count...). Also, the data to be binned can be numerical data but also categorical or date data. + +If you're looking instead for bar charts, i.e. representing data with rectangular +bar, go to the [Bar Chart tutorial](/python/bar-charts/). + ## Histogram with Plotly Express -In statistics, a [histogram](https://en.wikipedia.org/wiki/Histogram) is representation of the distribution of numerical data, where the data are binned and the count for each bin is represented. More generally, in plotly a histogram is an aggregated bar chart, with several possible aggregation functions (e.g. sum, average, count...). Also, the data to be binned can be numerical data but also categorical or date data. [Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on "tidy" data](/python/px-arguments/). @@ -331,6 +335,21 @@ fig.append_trace(trace5, 3, 2) fig.show() ``` +### See also: Bar Charts + +If you want to display information about the individual items within each histogram bar, then create a stacked bar chart with hover information as shown below. Note that this is not technically the histogram chart type, but it will have a similar effect as shown below by comparing the output of `px.histogram` and `px.bar`. For more information, see the [tutorial on bar charts](/python/bar-charts/). + +```python +import plotly.express as px +tips = px.data.tips() +fig1 = px.bar(tips, x='day', y='tip', height=300, + title='Stacked Bar Chart - Hover on individual items') +fig2 = px.histogram(tips, x='day', y='tip', histfunc='sum', height=300, + title='Histogram Chart') +fig1.show() +fig2.show() +``` + ### Dash Example diff --git a/python/parallel-categories-diagram.md b/python/parallel-categories-diagram.md index fde29e3fa..a0853c253 100644 --- a/python/parallel-categories-diagram.md +++ b/python/parallel-categories-diagram.md @@ -6,7 +6,7 @@ jupyter: extension: .md format_name: markdown format_version: '1.1' - jupytext_version: 1.2.1 + jupytext_version: 1.1.1 kernelspec: display_name: Python 3 language: python @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.6.8 + version: 3.7.3 plotly: description: How to make parallel categories diagrams in Python with Plotly. display_as: statistical @@ -38,6 +38,8 @@ The parallel categories diagram is a visualization of multi-dimensional categori Combinations of category rectangles across dimensions are connected by ribbons, where the height of the ribbon corresponds to the relative frequency of occurrence of the combination of categories in the data set. +For other representations of multivariate data, also see [parallel coordinates](/python/parallel-coordinates-plot/), [radar charts](/python/radar-chart/) and [scatterplot matrix (SPLOM)](/python/splom/). + #### Basic Parallel Category Diagram with plotly.express diff --git a/python/parallel-coordinates-plot.md b/python/parallel-coordinates-plot.md index 13a41f515..b5ac90e44 100644 --- a/python/parallel-coordinates-plot.md +++ b/python/parallel-coordinates-plot.md @@ -22,7 +22,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.6.7 + version: 3.7.3 plotly: description: How to make parallel coorindates plots in Python with Plotly. display_as: scientific @@ -37,7 +37,7 @@ jupyter: ## Parallel Coordinates plot with Plotly Express -[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on "tidy" data](/python/px-arguments/). In a parallel coordinates plot with `px.parallel_coordinates`, each row of the DataFrame is represented by a polyline mark which traverses a set of parallel axes, one for each of the dimensions. For other representations of multivariate data, also see [radar charts](/python/radar-chart/) and [scatterplot matrix (SPLOM)](/python/splom/). +[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on "tidy" data](/python/px-arguments/). In a parallel coordinates plot with `px.parallel_coordinates`, each row of the DataFrame is represented by a polyline mark which traverses a set of parallel axes, one for each of the dimensions. For other representations of multivariate data, also see [parallel categories](/python/parallel-categories-diagram/), [radar charts](/python/radar-chart/) and [scatterplot matrix (SPLOM)](/python/splom/). ```python import plotly.express as px diff --git a/python/pie-charts.md b/python/pie-charts.md index 1f3be6b38..457b993ae 100644 --- a/python/pie-charts.md +++ b/python/pie-charts.md @@ -20,7 +20,7 @@ jupyter: name: python nbconvert_exporter: python pygments_lexer: ipython3 - version: 3.6.7 + version: 3.7.3 plotly: description: How to make Pie Charts. display_as: basic @@ -35,7 +35,10 @@ jupyter: ### Basic Pie Chart ### -A pie chart ``go.Pie`` object is a circular statistical chart, which is divided into sectors to illustrate numerical proportion. Data visualized by the sectors of the pie is set in `values`. The sector labels are set in `labels`. The sector colors are set in `marker.colors`. +A pie chart ``go.Pie`` object is a circular statistical chart, which is divided into sectors to illustrate numerical proportion. Data visualized by the sectors of the pie is set in `values`. The sector labels are set in `labels`. The sector colors are set in `marker.colors`. + +If you're looking instead for a multilevel hierarchical pie-like chart, go to the +[Sunburst tutorial](/python/sunburst-charts/). ```python import plotly.graph_objects as go @@ -164,6 +167,24 @@ fig.update_layout(title_text='World GDP') fig.show() ``` +### See Also: Sunburst charts + +For multilevel pie charts representing hierarchical data, you can use the `Sunburst` chart. A simple example is given below, for more information see the [tutorial on Sunburst charts](/python/sunburst-charts/). + +```python +import plotly.graph_objects as go + +fig =go.Figure(go.Sunburst( + labels=["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"], + parents=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ], + values=[10, 14, 12, 10, 2, 6, 6, 4, 4], +)) +fig.update_layout(margin = dict(t=0, l=0, r=0, b=0)) + +fig.show() + +``` + ### Dash Example