Update: version 5.0 was released since this was posted.
I’m happy to announce that Plotly.py 4.14 is now available for download via pip
and conda
! For up-to-date installation and upgrading instructions (including the extra required steps for JupyterLab!) please see our Getting Started documentation page and if you run into trouble, check out our Troubleshooting Guide.
What’s new in Plotly.py 4.14
Our changelog has details and links to individual pull requests, but here are the highlights:
Faceted and Animated Images and Heatmaps with px.imshow()
The px.imshow()
function has always allowed you to visualize single-chanel 2-dimensional data as a heatmap, and 3-channel (RGB) 2-dimensional data as an image. As of this release, px.imshow()
supports 3- and 4-dimensional single and multi-channel data, via faceting and/or animation. This means that if you have a list or array of images, you can see them all at once side by side using facet_col
or you can step through them with a slider using animation_frame
, and if you have a list of lists of images, you can use both together! Of course, in addition to working with lists of lists and numpy
arrays, this also works well with the xarray
library, which is a common way of storing and processing these higher-dimensional arrays.
This feature, like the rest of the px.imshow()
function, was sponsored as part of a Chan-Zuckerberg Initiative Essential Open-Source Software for Science grant
Here are some examples of what this looks like:
Inside Tick Labels
For a cleaner look, you can now move the tick labels of your cartesian axes inside the plotting area, and the automatic ranging will leave enough room for the data to not overlap with the tick labels.
This feature was anonymously sponsored.
Smarter Axis Auto-Typing Behaviour
One issue which has bothered users of Plotly.py for years is that the axis type-detection system in Plotly.js by default treats numeric strings as numbers, which has caused it to automatically consider lists of strings containing a mix of numeric and non-numeric strings as mapping to linear
axes and thereby ignoring the non-numeric strings. In Plotly.py 4.14, numeric strings are now treated just like strings that don’t contain numbers for the purposes of axis type
detection, which should result in less surprise and confusion, and less need for forcing the axis type to category
when passing in lists of strings!
Powered by Plotly.js 1.58 and perfect for Dash 1.18
The version of Plotly.js that Plotly.py 4.14 is built on is the same one that’s bundled with the recently-released Dash 1.18 so we recommend that if you’re a Dash user you upgrade to both Dash 1.18 and Plotly.py 4.14 to get the full benefit of all of these libraries working together.
Get it now!
To sum up: Plotly.py 4.14 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, and don’t forget to upgrade your JupyterLab extensions if that is your environment of choice!
In Case You Missed It: Previous 4.x Announcements
- 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()
- Plotly.py 4.9:
- Kaleido for static image export
- Hexbin Tile Maps
- Timelines
- Plotly.py 4.8:
- Plotly Express Support for Wide- and Mixed-Form Data
- a Pandas backend
- Plotly.py 4.7:
- Major performance improvments
- Shape-drawing
- Plotly.py 4.6:
- unified hover labels
- excluding weekends from time-series axes
imshow
labelling andxarray
support