plotly.figure_factory module contains dedicated functions for creating very specific types of plots that were at the time of their creation difficult to create with graph objects and prior to the existence of Plotly Express. As new functionality gets added to Plotly.js and to Plotly Express, certain Figure Factories become unnecessary and are therefore deprecated as "legacy", but remain in the module for backwards-compatibility reasons.
The following types of plots are still difficult to create with Graph Objects or Plotly Express and therefore the corresponding Figure Factories are not deprecated:
- Annotated Heatmaps
- Hexagonal Binning Tile Map
- Quiver Plots
- Streamline Plots
- Ternary Contour Plots
- Triangulated Surface Plots
Deprecated "legacy" Figure Factories include:
- County Choropleth Maps, deprecated by regular Choropleth maps with GeoJSON input
- Distplots, mostly deprecated by
px.histogramexcept for KDE plots, which
px.histogramdoesn't support yet
- Gantt Charts, deprecated by
For more information about the contents of
plotly.figure_factory, including deprecated methods, please refer to our API Reference documentation.
What About Dash?¶
Learn about how to install Dash at https://dash.plot.ly/installation.
Everywhere in this page that you see
fig.show(), you can display the same figure in a Dash application by passing it to the
figure argument of the
Graph component from the built-in
dash_core_components package like this:
import plotly.graph_objects as go # or plotly.express as px fig = go.Figure() # or any Plotly Express function e.g. px.bar(...) # fig.add_trace( ... ) # fig.update_layout( ... ) import dash import dash_core_components as dcc import dash_html_components as html app = dash.Dash() app.layout = html.Div([ dcc.Graph(figure=fig) ]) app.run_server(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter