Update: version 4.12 has been released since this was posted.
I’m happy to announce that Plotly.py 4.10 is now available for download via
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.10
Our changelog has details and links to individual pull requests, but here are the highlights:
In Plotly.py 4.9 we introduced a new way of making timelines and Gantt charts with the
px.timeline() function. In Plotly.py 4.10 we have fixed a number of bugs and long-standing limitations that prevented some people from taking full advantage of this new function:
- Plotly Express no longer converts Pandas
datetimecolumns into UTC and instead renders figures “in local time” just like Graph Objects (#2311)
px.timeline()now works with time ranges smaller than 10 seconds. (#2658)
px.timeline()now works even when not all traces have the same categories. (#2684)
Beyond these features, we’ve added some new datetime-formatting options for text on figures, hover labels and tick labels by upgrading to version 4 of
d3-time-format: you can now display week (
%V) and quarter numbers (
%q) in these labels as well as some other frequently-requested options!
Finally, we’ve added a new
ticklabelmode attribute to X and Y axes, which lets you build more-intuitive time-series charts by controlling where tick labels go with respect to period boundaries. By default, tick labels in Plotly figures appear below gridlines and represent instants in time such as “00:00 on February 1, 2018” . The tick label text for such an instant can be formatted as “Feb 2018” but it will still appear centered on that instant, meaning that the “F” in “Feb” will appear below data points in January, as in the first plot below. Set the new
ticklabelmode attribute to
"period" to center tick labels on the period they represent, as in the second plot below, while leaving the grid lines in place at the period boundaries.
Here’s the same feature on a
This feature was anonymously sponsored, and we thank our benefactor on behalf of the community!
Full Figures for Development
fig.full_figure_for_development() function will return a new
go.Figure object, prepopulated with the same values you provided, as well as all the default values computed by Plotly.js, to allow you to learn more about what attributes control every detail of your figure and how you can customize them. This function is named “for development” because it’s not necessary to use it to produce figures, but it can be really handy to explore figures while you’re figuring out how to build them. Check out our new figure introspection documentation for more details and examples.
Last November, in Plotly.py 4.3, we added a new function
px.imshow() to easily visualize single-channel (heatmap) data as well as multi-channel (image) data. We’ve added a number of features to this function since then and in 4.10 we’ve tackled performance.
The biggest performance problem with
px.imshow() and the underlying
This can all be controlled by a new set of keyword arguments to
px.imshow() such as
binary_backend, which all have sensible defaults. Simply upgrading to Plotly.py 4.10 will yield performance benefits (especially in Dash apps!), and these arguments can then be tuned for your particular use-case.
Powered by Plotly.js 1.55 and perfect for Dash 1.16
The version of Plotly.js that Plotly.py 4.10 is built on is the same one that’s bundled with the just-released Dash 1.16 so we recommend that if you’re a Dash user you upgrade to both Dash 1.16 and Plotly.py 4.10 to get the full benefit of all of these libraries working together.
Get it now!
To sum up: Plotly.py 4.10 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
- Kaleido for static image export
- Hexbin Tile Maps
- Plotly Express Support for Wide- and Mixed-Form Data
- a Pandas backend
- Major performance improvments
- unified hover labels
- excluding weekends from time-series axes
- legend titles
- GeoJSON choropleth improvements
- a new sunburst/treemap
- new Plotly Express functions for pie charts, sunbursts, treemaps, funnels maps,
px.imshowfor heatmaps and full-color images
- facet wrapping in Plotly Express,
- Plotly Express input enhancements to work without data frames
- Mapbox maps without Mapbox tokens
- Choropleth and Density mapbox maps
- Indicators (big numbers, gauges, bullet charts)
Plotly.py 4.0 :
- displayable anywhere