You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
All notable changes to this project will be documented in this file.
3
3
This project adheres to [Semantic Versioning](http://semver.org/).
4
4
5
+
5
6
## [4.9.0] - unreleased
6
7
7
8
### Added
@@ -14,6 +15,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
14
15
15
16
- trendline traces are now of type `scattergl` when `render_mode="webgl"` in Plotly Express ([#2614](https://github.com/plotly/plotly.py/pull/2614))
16
17
18
+
### Updated
19
+
20
+
- Added all cartesian-2d Plotly Express functions, plus `imshow` to Pandas backend with `kind` option
21
+
-`plotly.express.imshow` now uses data frame index and columns names and values to populate axis parameters by default ([#2539](https://github.com/plotly/plotly.py/pull/2539))
22
+
23
+
17
24
18
25
## [4.8.2] - 2020-06-26
19
26
@@ -22,6 +29,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
22
29
- Updated Plotly.js to version 1.54.5. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/v1.54.5/CHANGELOG.md) for more information.
23
30
-`add_traces()` now accepts bare `int`-like values for `rows`/`cols` as well as lists thereof ([#2546](https://github.com/plotly/plotly.py/pull/2546)), with thanks to [@MCBoarder289](https://github.com/MCBoarder289) for the contribution!
24
31
32
+
25
33
### Fixed
26
34
27
35
-`row`/`col` now accept `int`-like values, not strictly `int` values ([#2451](https://github.com/plotly/plotly.py/pull/2451)), with thanks to [@MCBoarder289](https://github.com/MCBoarder289) for the contribution!
Copy file name to clipboardExpand all lines: doc/python/facet-plots.md
+21-4
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ jupyter:
6
6
extension: .md
7
7
format_name: markdown
8
8
format_version: '1.2'
9
-
jupytext_version: 1.3.4
9
+
jupytext_version: 1.4.2
10
10
kernelspec:
11
11
display_name: Python 3
12
12
language: python
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.7.0
23
+
version: 3.7.7
24
24
plotly:
25
25
description: How to make Facet and Trellis Plots in Python with Plotly.
26
26
display_as: statistical
@@ -103,7 +103,7 @@ fig.show()
103
103
104
104
### Customize Subplot Figure Titles
105
105
106
-
Since subplot figure titles are [annotations](https://plotly.com/python/text-and-annotations/#simple-annotation), you can use the `for_each_annotation` function to customize them.
106
+
Since subplot figure titles are [annotations](https://plotly.com/python/text-and-annotations/#simple-annotation), you can use the `for_each_annotation` function to customize them, for example to remove the equal-sign (`=`).
107
107
108
108
In the following example, we pass a lambda function to `for_each_annotation` in order to change the figure subplot titles from `smoker=No` and `smoker=Yes` to just `No` and `Yes`.
The `facet_row_spacing` and `facet_col_spacing` arguments can be used to control the spacing between rows and columns. These values are specified in fractions of the plotting area in paper coordinates and not in pixels, so they will grow or shrink with the `width` and `height` of the figure.
121
+
122
+
The defaults work well with 1-4 rows or columns at the default figure size with the default font size, but need to be reduced to around 0.01 for very large figures or figures with many rows or columns. Conversely, if activating tick labels on all facets, the spacing will need to be increased.
Copy file name to clipboardExpand all lines: doc/python/heatmaps.md
+10-2
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ jupyter:
36
36
37
37
### Heatmap with `plotly.express` and `px.imshow`
38
38
39
-
[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/). With `px.imshow`, each value of the input array is represented as a heatmap pixel.
39
+
[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/). With `px.imshow`, each value of the input array or data frame is represented as a heatmap pixel.
40
40
41
41
For more examples using `px.imshow`, see the [tutorial on displaying image data with plotly](/python/imshow).
42
42
@@ -49,6 +49,14 @@ fig = px.imshow([[1, 20, 30],
49
49
fig.show()
50
50
```
51
51
52
+
```python
53
+
import plotly.express as px
54
+
55
+
df = px.data.medals_wide(indexed=True)
56
+
fig = px.imshow(df)
57
+
fig.show()
58
+
```
59
+
52
60
### Customizing the axes and labels on a heatmap
53
61
54
62
You can use the `x`, `y` and `labels` arguments to customize the display of a heatmap, and use `.update_xaxes()` to move the x axis tick labels to the top:
@@ -182,4 +190,4 @@ Arrays of rasterized values build by datashader can be visualized using
182
190
plotly's heatmaps, as shown in the [plotly and datashader tutorial](/python/datashader/).
183
191
184
192
#### Reference
185
-
See https://plotly.com/python/reference/#heatmap for more information and chart attribute options!
193
+
See https://plotly.com/python/reference/#heatmap for more information and chart attribute options!
Copy file name to clipboardExpand all lines: doc/python/pandas-backend.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ fig.show()
98
98
99
99
### Supported Methods
100
100
101
-
The Plotly backend supports the following `kind`s of Pandas plots: `scatter`, `line`, `area`, `bar`, `barh`, `hist` and `box`, via the call pattern `df.plot(kind='scatter')` or `df.plot.scatter()`. These delegate to the corresponding Plotly Express functions.
101
+
The Plotly backend supports the following `kind`s of Pandas plots: `scatter`, `line`, `area`, `bar`, `barh`, `hist` and `box`, via the call pattern `df.plot(kind='scatter')` or `df.plot.scatter()`. These delegate to the corresponding Plotly Express functions. In addition, the following are valid options to the `kind` argument of `df.plot()`: `violin`, `strip`, `funnel`, `density_heatmap`, `density_contour` and `imshow`, even though the call pattern `df.plot.violin()` is not supported for these kinds of charts, per the Pandas API.
102
102
103
103
```python
104
104
import pandas as pd
@@ -198,4 +198,4 @@ fig.show()
198
198
199
199
### What about Cufflinks?
200
200
201
-
There also exists an independent third-party wrapper library around Plotly called [Cufflinks](https://github.com/santosjorge/cufflinks), which provides similar functionality (with an API closer to that of Pandas' default `matplotlib` backend) by adding a `.iplot()` method to Pandas dataframes, as it was developed before Pandas supported configurable backends. Issues and questions regarding Cufflinks should be [raised in the Cufflinks repository](https://github.com/santosjorge/cufflinks/issues/new).
201
+
There also exists an independent third-party wrapper library around Plotly called [Cufflinks](https://github.com/santosjorge/cufflinks), which provides similar functionality (with an API closer to that of Pandas' default `matplotlib` backend) by adding a `.iplot()` method to Pandas dataframes, as it was developed before Pandas supported configurable backends. Issues and questions regarding Cufflinks should be [raised in the Cufflinks repository](https://github.com/santosjorge/cufflinks/issues/new).
Copy file name to clipboardExpand all lines: doc/python/px-arguments.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ There are three common conventions for storing column-oriented data, usually in
49
49
***wide-form data** has one row per value of one of the first variable, and one column per value of the second variable. This is suitable for storing and displaying 2-dimensional data.
50
50
***mixed-form data** is a hybrid of long-form and wide-form data, with one row per value of one variable, and some columns representing values of another, and some columns representing more variables. See the [wide-form documentation](/python/wide-form/) for examples of how to use Plotly Express to visualize this kind of data.
51
51
52
-
Every Plotly Express function other than `imshow`can operate on long-form data, and in addition, the following 2D-Cartesian functions can operate on wide-form and mixed-form data: `px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`.
52
+
Every Plotly Express function can operate on long-form data (other than `px.imshow`which operates only on wide-form input), and in addition, the following 2D-Cartesian functions can operate on wide-form and mixed-form data: `px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`.
53
53
54
54
By way of example here is the same data, represented in long-form first, and then in wide-form:
Copy file name to clipboardExpand all lines: doc/python/wide-form.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ There are three common conventions for storing column-oriented data, usually in
48
48
***wide-form data** has one row per value of one of the first variable, and one column per value of the second variable. This is suitable for storing and displaying 2-dimensional data.
49
49
***mixed-form data** is a hybrid of long-form and wide-form data, with one row per value of one variable, and some columns representing values of another, and some columns representing more variables.
50
50
51
-
Every Plotly Express function other than `imshow`can operate on long-form data, and in addition, the following 2D-Cartesian functions can operate on wide-form and mixed-form data: `px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`.
51
+
Every Plotly Express function can operate on long-form data (other than `px.imshow`which operates only on wide-form input), and in addition, the following 2D-Cartesian functions can operate on wide-form and mixed-form data: `px.scatter`, `px.line`, `px.area`, `px.bar`, `px.histogram`, `px.violin`, `px.box`, `px.strip`, `px.funnel`, `px.density_heatmap` and `px.density_contour`.
52
52
53
53
By way of example here is the same data, represented in long-form first, and then in wide-form:
0 commit comments