Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions python/axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions python/creating-and-updating-figures.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 21 additions & 2 deletions python/histograms.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/).

Expand Down Expand Up @@ -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


Expand Down
6 changes: 4 additions & 2 deletions python/parallel-categories-diagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions python/parallel-coordinates-plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
25 changes: 23 additions & 2 deletions python/pie-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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


Expand Down