Update: version 5.8.0 was released since this was posted.
Iโm happy to announce that Plotly.py 5.7.0 is now available for download via pip
and conda
! For up-to-date installation and upgrading instructions please see our Getting Started documentation page and if you run into trouble, check out our Troubleshooting Guide.
This is a combined announcement for versions 5.3.0 through 5.7.0. Check out the full changelog or scroll down for the highlights.
Easy Text on Histograms, Heatmaps and more with text_auto
Itโs now trivial to display the Y value as text on bar charts and histograms, or the Z value on heatmaps with px.imshow()
or on 2d histograms, using Plotly Expressโ new text_auto
argument. This is one less reason to use the deprecated create_annotated_heatmap
figure factory, and one more reason to use px.imshow()
instead!
import plotly.express as px
df = px.data.medals_wide(indexed=True)
fig = px.imshow(df, text_auto=True)
fig.show()
Pattern fills on Area charts
Area charts now support pattern fills (aka texture or hachure) for greater accessibilty or low-color rendering such as for print. This feature was implemented by Github user @s417-lama and we thank them on behalf of the community!
import plotly.express as px
df = px.data.medals_long()
fig = px.area(df, x="medal", y="count", color="nation",
pattern_shape="nation", pattern_shape_sequence=[".", "x", "+"])
fig.show()
Skip tick labels with ticklabelstep
By default, cartesian axes will render with one tick label per gridline, but you can now render fewer tick labels using the layout.xaxis.ticklabelstep
attribute (and this works on the yaxis
also of course, as in the example below!).
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", facet_col="species")
fig.update_yaxes(ticklabelstep=2)
fig.show()
This feature was anonymously sponsored .
Smith Charts
You can now make Smith Charts with Plotly! A Smith Chart is a specialized chart for visualizing complex numbers: numbers with both a real and imaginary part.
import plotly.graph_objects as go
fig = go.Figure(go.Scattersmith(imag=[0.5, 1, 2, 3], real=[0.5, 1, 2, 3]))
fig.show()
Controlling legend groups with legend.groupclick
By default, clicking on legend items for traces in the same group toggles the visibility of the entire group. You can now set this to toggling individual items with the layout.legend.groupclick
attribute.
This feature was anonymously sponsored .
Easy access to your Plotly.js version number
A common problem while debugging Plotly figures, especially when using Dash, is making sure that the underlying version of Plotly.js supports the features youโre trying to use. You can now see the exact version of Plotly.js (not Plotly.py!) that is rendering your chart by mousing over the logo in the modebar in the top-right corner of figures. If you donโt see the version number, then the version is below 2.9.0.
Powered by Plotly.js 2.11.1 and perfect for Dash 2.3.1
The version of Plotly.js that Plotly.py 5.7.0 is built on is the same one thatโs bundled with the recently-released Dash 2.3.1 so we recommend that if youโre a Dash user you upgrade to Dash 2.3.1, to get the full benefit of all of these libraries working together.
Get it now!
To sum up: Plotly.py 5.7.0 is out and if youโre excited about any of the above features, head on over to our Getting Started documentation page for full installation instructions!
In Case You Missed It: Previous Announcements
- Plotly.py 5.2
- Trendlines
- ECDF Plots
- Markers on Lines
- Sharper WebGL
- Plotly.py 5.1
- Legend Group Titles
- Plotly.py 5.0
- A combined, federated JupyterLab Extension
- Bar Chart Patterns (aka Hatching or Textures)
- Icicle and Flame Charts
- Explicit Legend-Item Ordering
- Faster JSON serialization with
orjson
- Plotly.py 4.14
- Faceted and Animated Images and Heatmaps with
px.imshow()
- Inside Tick Labels
- Smarter Axis Auto-Typing Behaviour
- Faceted and Animated Images and Heatmaps with
- Plotly.py 4.13
- Magical error messages
- Performance improvements (including for Dash!)
- Faceted Maps
- Plotly.py 4.12:
- Horizontal and vertical lines and rectangles
- Plotly.py 4.11:
- Period positioning on
date
axes
- Period positioning on
- Plotly.py 4.10:
date
-axis andpx.timeline()
improvements- Full Figures for Development
- A Faster
px.imshow()