The interactive graphing library for Python (includes Plotly Express) :sparkles:

Overview

plotly.py

Latest Release
User forum
PyPI Downloads
License

Data Science Workspaces

Our recommended IDE for Plotly’s Python graphing library is Dash Enterprise’s Data Science Workspaces, which has both Jupyter notebook and Python code file support.

Quickstart

pip install plotly==4.14.3

Inside Jupyter notebook (installable with pip install "notebook>=5.3" "ipywidgets>=7.5"):

import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scatter(y=[2, 1, 4, 3]))
fig.add_trace(go.Bar(y=[1, 4, 3, 2]))
fig.update_layout(title = 'Hello Figure')
fig.show()

See the Python documentation for more examples.

Read about what's new in plotly.py v4

Overview

plotly.py is an interactive, open-source, and browser-based graphing library for Python

Built on top of plotly.js, plotly.py is a high-level, declarative charting library. plotly.js ships with over 30 chart types, including scientific charts, 3D graphs, statistical charts, SVG maps, financial charts, and more.

plotly.py is MIT Licensed. Plotly graphs can be viewed in Jupyter notebooks, standalone HTML files, or hosted online using Chart Studio Cloud.

Contact us for consulting, dashboard development, application integration, and feature additions.



Installation

plotly.py may be installed using pip...

pip install plotly==4.14.3

or conda.

conda install -c plotly plotly=4.14.3

Jupyter Notebook Support

For use in the Jupyter Notebook, install the notebook and ipywidgets packages using pip:

pip install "notebook>=5.3" "ipywidgets>=7.5"

or conda:

conda install "notebook>=5.3" "ipywidgets>=7.5"

JupyterLab Support

For use in JupyterLab, install the jupyterlab and ipywidgets packages using pip:

pip install jupyterlab "ipywidgets>=7.5"

or conda:

conda install jupyterlab "ipywidgets>=7.5"

Then run the following commands to install the required JupyterLab extensions (note that this will require node to be installed):

# Basic JupyterLab renderer support
jupyter labextension install [email protected]

# OPTIONAL: Jupyter widgets extension for FigureWidget support
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected]

Please check out our Troubleshooting guide if you run into any problems with JupyterLab.

Static Image Export

plotly.py supports static image export, using either the kaleido package (recommended, supported as of plotly version 4.9) or the orca command line utility (legacy as of plotly version 4.9).

Kaleido

The kaleido package has no dependencies and can be installed using pip...

$ pip install -U kaleido

or conda.

$ conda install -c conda-forge python-kaleido

Orca

While Kaleido is now the recommended image export approach because it is easier to install and more widely compatible, static image export can also be supported by the legacy orca command line utility and the psutil Python package.

These dependencies can both be installed using conda:

conda install -c plotly plotly-orca==1.3.1 psutil

Or, psutil can be installed using pip...

pip install psutil

and orca can be installed according to the instructions in the orca README.

Extended Geo Support

Some plotly.py features rely on fairly large geographic shape files. The county choropleth figure factory is one such example. These shape files are distributed as a separate plotly-geo package. This package can be installed using pip...

pip install plotly-geo==1.0.0

or conda

conda install -c plotly plotly-geo=1.0.0

Chart Studio support

The chart-studio package can be used to upload plotly figures to Plotly's Chart Studio Cloud or On-Prem service. This package can be installed using pip...

pip install chart-studio==1.1.0

or conda

conda install -c plotly chart-studio=1.1.0

Migration

If you're migrating from plotly.py v3 to v4, please check out the Version 4 migration guide

If you're migrating from plotly.py v2 to v3, please check out the Version 3 migration guide

Copyright and Licenses

Code and documentation copyright 2019 Plotly, Inc.

Code released under the MIT license.

Docs released under the Creative Commons license.

Issues
  • [WIP] Plotly 3.0.0 - Deep Jupyter Integration, Validation, Performance, and More

    [WIP] Plotly 3.0.0 - Deep Jupyter Integration, Validation, Performance, and More

    Update: June 27, 2018

    This branch will mark a major release of the plotly.py branch, Version 3.0.0 There are many new and great features in this branch including deeper Jupyter integration, deeper figure validation, improved performance, and more. You can try this out with a prerelease version, see https://pypi.org/project/plotly/#history for the latest. To install and enable with Jupyter, run:

    pip install plotly==3.0.0rc11
    pip install "notebook>=5.3" "ipywidgets>=7.2"  # only necessary for Jupyter Notebook environments
    

    If you're using older versions of notebook or ipywidgets you may need to manually activate the widget extensions (this should not be needed for notebook>=5.3 and ipywidgets>=7.2)

    jupyter nbextension enable --py widgetsnbextension --sys-prefix
    jupyter nbextension enable --py plotlywidget --sys-prefix
    

    In addition, to add JupyterLab support run the following commands:

    pip install jupyterlab
    jupyter labextension install @jupyter-widgets/jupyterlab-manager # install the Jupyter widgets extension
    jupyter labextension install [email protected]
    

    The original message from February 19, 2018 is below:

    Alright, here we go! @chriddyp @jackparmer

    Overview This is a first cut at integrating the work I started in the ipyplotly project into plotly.py.

    Integration Approach I moved the new object hierarchy to plotly/datatypes. I modified the graph_objs.py code generation logic to remap Figure, Layout, and all of the trace objects (Bar, Scatter, etc.) to the corresponding objects in the new datatypes hierarchy. All of the other classes in graph_objs were converted into list or dict subclasses. This is simply for backwards compatibility for the time being, I'm not sure what we want to do with these in the long run.

    Widget notes The backend ipywidget logic is implemented in the new datatypes.Figure and datatypes.FigureWidget classes. The front-end logic is implemented in the js/ directory.

    Examples See the notebooks in specs/ipyplotly_integration for an overview of the new functionality.

    TODO

    • [x] Support dict-style .update method on all datatypes
    • [x] Assess existing tests and catalog breakage
    • [x] Python 2.7 support
    • [x] JupyterLab support
    • [x] Update README with some examples from Overview.ipynb
    • [x] Reformat for 79 character width (plus PEP8 in general)

    Failing test modes Summary of reasons for current test failures

    • unexpected keyword argument '_raise' (test_get_figure). Looks like old graph objects had a _raise constructor parameter to control whether validation was performed. I'm not sure why this was needed, but validation isn't optional for the new objects.
    • Validation exceptions not raised on compatibility classes. Some of the current graph_objs.py classes don't directly map to objects in the new hierarchy, and they are currently included as dict/list subclasses for source compatibility. e.g.
      • Sequence types like Annotations don't have an equivalent because sequences are now represented as tuples of compound types. For instance, the annotations property of Layout accepts tuples of datatypes.layout.Annotation objects and there is no Annotations type.
      • Types like Marker, ColorBar, ErrorX, Font, Line, Frames, etc. are replaced by more precise types. For example, there is now a trace.scatter.Marker class and a trace.bar.Marker class and they each contain only the properties that are valid for their trace type.
    • New datatype objects don't have a validate() method
    • Subplot properties may only be suffixed by an integer > 1. See https://github.com/plotly/plotly.py/pull/956#issuecomment-371340640 for some comments. The documentation and schema of Plotly.js seem to disallow subplotid properties ending in 1. (x, x2, x3, but not x1).
    • There is no get_data method on datatype objects. This had a flatten option to return a dict with keys like foo.bar.baz. I think this could be implemented on the new objects if there's a need for.
    • Errors in test_graph_objs.py because the collection of classes in graph_objs.py has changed.
    • Datatypes are no longer dict subclasses so tests like assert Scatter() == dict(type='scatter') fail.
    • Exception types don't always match: The current datatype/validator logic mostly raises ValueError and KeyError exceptions. Many of the tests expect a PlotlyError.
    • There is no strip_style method on datatypes. The new logic doesn't maintain the style meta-data after code generation, but it would be possible to add this if this method needs to be preserved.
    • Datatypes have no to_string method, but again this could be added.
    • Invalid value of type 'plotly.grid_objs.grid_objs.Column' received for the 'xsrc' property of trace.scatter: grid_objs aren't accepted as *src properties
    • Scalar values aren't currently accepted as data_array types (e.g. scatter.x). This breaks some of the streaming tests which have things like my_stream.write(Scatter(x=1, y=10), ...)
    • It's not valid to pass a dictionary of object properties to the constructor of a data type without kwarg expansion. Scatter({'x': ..., 'y': ...}) is invalid, need to do Scatter(**{'x': ..., 'y': ...}). This breaks the tools.py/validate function.
    • The layout.width/height properties are numbers (according to the schema), but the dendrogram figure_factory sets height to the string '100%'.
    • All data_array typed properties are converted to read-only numpy arrays internally. So comparisons that expect lists fail (see TestStreamline/test_simple_streamline)
    • flaglist/enumeration types are case sensitive. Causes failure in TestTrisurf/test_trisurf_all_args because hoverinfo is set to 'None' rather than 'none'
    • 'Figure' object has no attribute 'to_dataframe': I'm not really clear on what this method is supposed to do in general.
    • 'dot' is in invalid marker type (according to the schema). Used in test_optional/test_matplotlylib/data/scatter.py/SIMPLE_SCATTER
    • AttributeError: module 'plotly.graph_objs.graph_objs' has no attribute 'Histogram2dcontour': It's Histogram2dContour. We could support both versions if we need to.
    • There are a buch of JSON encoding failure that seem to relate to date encoding.

    Summary Missing methods on datatypes

    • to_string [removing]
    • strip_style [removing]
    • get_data [removing]
    • validate [removing]
    • to_dataframe [removing]

    Next steps

    • [x] Support strict flag in string validator (see plotly/plotly.js#2523).
    • [x] Remove hard numpy dependency. Support storing data_arrays as lists internally, but convert to tuples on property access.
    • [x] Investigate improving import performance and reenabling recursive submodule imports.
    • [x] add optional row/col support to add_traces. Deprecate append_traces and remap to add_traces with row/col args.
    • [x] Make ipywidgets an optional dependency, only loaded when FigureWidget constructor is called.
    • [x] Remove all use of deprecated classes in figure_factory, matplotlylib, etc.
      • [x] tests
      • [x] the actual modules users call
    enhancement breaking change jupyter 
    opened by jonmmease 153
  • Revamp tls.get_subplots

    Revamp tls.get_subplots

    @theengineear @chriddyp

    tls.get_subplots is in need of some revamping.

    More info in this Asana task.

    This NB shows off the new features.

    Features wishlist:

    • [x] Generate more complicated subplot arrangements e.g https://plot.ly/~etpinard/245
    • [x] Assign shared axes
    • [x] Set irregular horizontal and vertical spacing in-between subplots
    • [x] Generate subscenes - subaxes subplot grid.
    • [x] Generate insets with ease

    API issue to resolve:

    • [x] rowspan > 1 and is_empty https://github.com/plotly/python-api/pull/170#discussion_r22334996

    Solution: Enforce specs to have dimensions (rows, columns). Use None to fill in cells over row / column spans.

    • [x] Ordering of the specs keyword argument https://github.com/plotly/python-api/pull/170#issuecomment-68561185
    opened by etpinard 66
  • Refactor JupyterLab JS extensions and package as federated extension

    Refactor JupyterLab JS extensions and package as federated extension

    This PR:

    • [x] merges the widget and the jupyterlab render extensions into one unique package (an example out there is https://github.com/deathbeds/ipydrawio/blob/master/packages/ipydrawio).
    • [x] packages the jupyterlab extension as federated module (fixes #3036)
    • [x] import asynchronously plotly.js

    • [x] I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the codegen files and not generated files.
    • [x] I have added tests (if submitting a new feature or correcting a bug) or modified existing tests.
    • [x] For a new feature, I have added documentation examples in an existing or new tutorial notebook (please see the doc checklist as well).
    • [ ] I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
    • [x] For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well).
    opened by fcollonval 55
  • Updated method for ternary contour figure factory

    Updated method for ternary contour figure factory

    Following the suggestions in #1413, and help from @empet, here is an alternative version for implementing contour plots in ternary diagrams.

    Pros: this method uses a ScatterTernary trace, meaning that it is natively an object of a ternary plot, hence it uses the ternary pan/zoom. Cons: the trace is not a Contour trace, hence quite a lot of boilerplate code will be needed for handling colorscale, colorbar, etc.

    I post here a first proof of concept, the PR is far from being finished (TODO: fix tests, fix documentation, implement annotations better etc.).

    @empet: I haven't had the time yet to compare this method with yours using ILR transform, but I'll surely do!

    opened by emmanuelle 49
  • Adding Scatterplot Matrix to FigureFactory

    Adding Scatterplot Matrix to FigureFactory

    @cldougl

    This is the first PR for the Scatterplot Matrix in the FigureFactory class in tools.py. The function currently takes in only pandas dataframes, does sanity checks on the dataframe (more than one column, either strings or numbers within a column, etc.) and then builds a scatterplot matrix based on this input. There is an option for indexing by one of the columns which must be inputted by the user (parameter: index) and for either a scatterplot or histogram along the main diagonal (parameter: diagonal).

    Things I am working on implementing:

    • I want to integrate a jitter parameter that adds random noise to the scatterplot so that densities can be easily seen in a plot. I already have a jitter parameter, but it only works in certain places.
    • I also am working to add to more options for diagonal plots, such as a 2d density and box plot.
    • Adding more parameters and options to the scatterplot (eg. showgrid) is also another thing I am working on expanding. dkjb stats heart rate against time
    opened by Kully 44
  • Update graph reference

    Update graph reference

    Alright, the real deal!

    TODO:

    • [x] add back deprecation warnings with _deprecated
    • [x] ~~use hrName~~
    • [x] wait, don't use hrname :) (it adds unnecessary maintenance overhead)
    • [x] use _isSubplotObj
    • [x] stop hard coding meta keys
    • [x] skipped tests need attached GH issues
    • [x] :tiger2: for graph_objs_tools.py
    • [x] discuss #291 (copy stuff), #290 (key ordering), #289 (pretty help), #293 (schema as singleton)
    • [x] :dolls: need a final revisit
    • [x] fix up some test code that uses deprecated keys
    • [x] incorporate new deprecated role definitions
    • [x] ~~use descriptions from deprecated fields in warnings~~ i'm now pointing users to call help appropriately. i think this is good enough.
    • [ ] gotta make sure this doesn't break anything in cufflinks
    • [x] don't add new class definitions (only for traces)
    opened by theengineear 44
  • Sparklines Figure Factory

    Sparklines Figure Factory

    @jackparmer progress so far

    screen shot 2017-11-29 at 3 28 32 pm

    you can set column_widths (like in go.Table) with a list [1, 4, 2, ...] you set the chart types with a list: i.e. the one above is produced with chart_types=['name', 'bullet', 'line', 'avg', 'bar']

    # TODO:
    # add  more color variety
    # add tests
    

    any suggestions?

    opened by Kully 42
  • Jupyterlab 3.x.x support

    Jupyterlab 3.x.x support

    With a fresh install of Jupyterlab version 3.0.0, installing plotly with the command jupyter labextension install [email protected] yields an error:

    An error occured.
    ValueError: 
    "[email protected]" is not compatible with the current JupyterLab
    Conflicting Dependencies:
    JupyterLab                        Extension      Package
    >=3.0.0 <3.1.0                    >=1.3.0 <2.0.0||>=2.0.0 <[email protected]/rendermime-interfaces
    

    Obviously this is a bleeding edge issue and very much a feature request, not a bug, I just wanted to make sure it was documented. Thank you!

    opened by bdecato 41
  • Offline mode not displaying inline in Jupyter notebook master?

    Offline mode not displaying inline in Jupyter notebook master?

    I hadn't tested recently, but today, using master of the Jupyter notebook, I can't get offline plots to display inline, instead I get the external temporary file. Consider this simple test:

    from plotly import __version__
    from plotly.offline import init_notebook_mode, plot
    from plotly.graph_objs import Scatter
    
    init_notebook_mode()
    
    print("plotly version:", __version__)
    plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])])
    

    I get for output:

    plotly version: 1.9.10
    Out[1]: 'file:///Users/fperez/tmp/temp-plot.html'
    

    and the plot correctly opening in a new tab by itself, but no inline notebook output. Here's a screenshot for reference:

    image

    In the JS console, I don't see anything that immediately points to the problem. Here's a screenshot, b/c copy-pasting text from the JS console makes a mish-mash of the formatting:

    image

    The above were from current Chrome on OSX, but I replicated the problem on Safari.

    Any thoughts on how to proceed much appreciated. Thanks!

    opened by fperez 41
  • Import and initialization optimizations

    Import and initialization optimizations

    Overview

    This PR contains a variety of optimizations targeted and improving plotly.py's import and Figure creation/serialization speed.

    Lazy submodule imports in Python 3.7+

    PEP-562 in Python 3.7 introduced a nice approach for implementing lazy loading of submodules. The top-level plotly/__init__.py, plotly/io/__init__.py and the full graph_objs hierarchy have been updated to use lazy submodule importing for Python 3.7+. For older Python versions, all submodule imports are still performed immediately.

    Part of this process involved codegen updates to split graph object and validator classes into their own files.

    Lazy creation of validators

    Previously, each graph object would instantiate a set of validators (one per property) in the constructor. Now, validators are constructed when first used, and they are stored in a global cache (plotly/validator_cache.py)

    Lazy creation of child graph objects

    Previously, child graph objects were created in the constructor, and they were initialized for every possible property. Now, graph objects initialized either on property access or when the property is set to a non-None value (if validation is enabled, see below).

    Avoid loading numpy and pandas when not in use

    In several places in the codebase, we attempt to import numpy/pandas using our get_module function, and then use the pandas/numpy module handle to check whether an argument is a data structure from that library. The get_module function now has a should_load option. When set to False, get_module will only return the module if it is already loaded. This is useful because if pandas isn't loaded, then we don't need to check whether a value is a DataFrame. This keeps us from having to pay the pandas/numpy import cost when these libraries are installed but not in use. This saves ~200ms when pandas/numpy are installed but not in use.

    Avoid dynamic docstring generation

    This PR removes the dynamic docstring generation that was used to populate the docstrings for the Figure methods corresponding to plotly.io functions (e.g. Figure.show with created by transforming plotly.io.show). These docstrings were added statically. This saves ~200ms on import time.

    Support optional validation

    This PR adds support for disabling property validation using the go.validation object. This can be used as a callable to enable/disable validation for the session (e.g. go.validation(False)), or it can be used as a context manager to enable/disable validation within block of code (e.g. with go.validation(False):).

    API inspired by Bokeh's implementation in https://github.com/bokeh/bokeh/issues/6042.

    Results

    Here are some before/after performance results on Python 3.7 with this PR:

    top-level import

    %%time
    import plotly
    

    Version 4.6: 239 ms PR: 2.5ms 95x speedup

    Import, create empty figure, and serialize to JSON

    %%time
    import plotly.graph_objects as go
    go.Figure().to_json()
    

    Version 4.6: 696 ms PR: 27ms 25x speedup

    Repeatedly create empty figure and serialize to json (after import)

    %%timeit
    go.Figure().to_json()
    

    Version 4.6: 68 ms PR: 1.5ms 45x speedup

    Import, load data, create animated plotly express figure, serialize to json

    %%time
    import plotly.express as px
    df = px.data.gapminder()
    fig = px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year", animation_group="country",
               size="pop", color="continent", hover_name="country", facet_col="continent",
               log_x=True, size_max=45, range_x=[100,100000], range_y=[25,90])
    fig.to_json()
    

    Version 4.6: 1530 ms PR: 550 ms 2.7x speedup

    Repeatedly create px plot after import and data are loaded

    %%timeit
    fig = px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year", animation_group="country",
               size="pop", color="continent", hover_name="country", facet_col="continent",
               log_x=True, size_max=45, range_x=[100,100000], range_y=[25,90])
    fig.to_json()
    

    Version 4.6: 663 ms PR: 167 ms 4x speedup

    Import, load data, create animated plotly express figure, serialize to json, skip validation

    %%time
    import plotly.express as px
    import plotly.graph_objects as go
    df = px.data.gapminder()
    with go.validate(False):
        fig = px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year", animation_group="country",
                   size="pop", color="continent", hover_name="country", facet_col="continent",
                   log_x=True, size_max=45, range_x=[100,100000], range_y=[25,90])
        fig.to_json()
    

    PR (no validation): 449 ms PR (with validation): 550 ms Version 4.6: 1530 ms

    Repeatedly import, load data, create animated plotly express figure, serialize to json, skip validation

    %%timeit
    with go.validate(False):
        fig = px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year", animation_group="country",
                   size="pop", color="continent", hover_name="country", facet_col="continent",
                   log_x=True, size_max=45, range_x=[100,100000], range_y=[25,90])
    

    PR (no validation): 127ms PR (with validation): 167ms Version 4.6: 663 ms

    cc @nicolaskruchten @emmanuelle

    opened by jonmmease 39
  • add_shape, add_layout_image, add_annotation for multiple facets at once, add_hline and add_vline (+add_vrect/add_hrect)

    add_shape, add_layout_image, add_annotation for multiple facets at once, add_hline and add_vline (+add_vrect/add_hrect)

    Closes #2141 and closes #2140

    Making it possible to specify multiple rows and columns when using add_shape, add_layout_image or add_annotation. This pull request is to share the work, so a lot is missing still.

    Code PR

    • [x] I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the codegen files and not generated files.
    • [ ] I have added tests (if submitting a new feature or correcting a bug) or modified existing tests.
    • [ ] For a new feature, I have added documentation examples in an existing or new tutorial notebook (please see the doc checklist as well).
    • [ ] I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
    opened by nicholas-esterer 38
  • ValueError: Invalid property specified for object of type plotly.graph_objs.layout.Shape: 'symbol'

    ValueError: Invalid property specified for object of type plotly.graph_objs.layout.Shape: 'symbol'

    Reproducible example:

    import matplotlib.pyplot as plt
    from plotly import tools
    
    fig, ax = plt.subplots()
    ax.plot([0, 1], [0, 1], "s-", label="foo")
    ax.legend()
    
    tools.mpl_to_plotly(fig)
    

    Works fine without legend or explicit fmt.

    This issue is quite severe because it disallows to use some sklearn visualizations:

    from sklearn.calibration import CalibrationDisplay
    from plotly import tools
    
    display = CalibrationDisplay.from_predictions([1], [0.9])
    
    tools.mpl_to_plotly(display.figure_)
    
    opened by apalkanau 0
  • Add Dash Club snippet

    Add Dash Club snippet

    @Coding-with-Adam, as requested, this adds the Dash Club snippet that we already have on the Dash docs. Adds it to the ten most popular pages here to get started.

    opened by LiamConnors 1
  • bug fix from matplotlib.collections api change

    bug fix from matplotlib.collections api change

    The matplotlib.collections.Collection object used to have offsets accessible via the get_offset_positions method, which was deprecated in favor of a hidden attribute _offset_position. There was a cold path in mplexported that used the old method and causes certain conversions to fail.

    opened by bcsherma 0
  • How to override box chart hover template, trace name is repeating in each property on hover.

    How to override box chart hover template, trace name is repeating in each property on hover.

    import plotly.graph_objects as go
    from plotly.data import iris
    
    # Load the dataset
    df = iris()
    
    fig = go.Figure()
    
    fig.add_box(x =df['sepal_length'],name='sepal_length')
    fig.add_box(x =df['sepal_width'],name='sepal_width')
    fig.add_box(x=df['petal_length'],name='petal_length')
    fig.add_box(x=df['petal_width'],name='petal_width')
    
    fig.update_layout(template ='gridon')
    fig.show()
    

    image

    How to Remove the Trace name i.e. "petal width", from hover of each property of box plot? having legend intact.

    opened by patilabhay679 0
Releases(v5.9.0)
  • v5.9.0(Jun 24, 2022)

    Added

    • pattern_shape options now available in px.timeline() #3774
    • facet_* and category_orders now available in px.pie() #3775

    Performance

    • px methods no longer call groupby on the input dataframe when the result would be a single group, and no longer groups by a lambda, for significant speedups #3765 with thanks to @jvdd

    Updated

    • Allow non-string extras in flaglist attributes, to support upcoming changes to ax.automargin in plotly.js plotly.js#6193, #3749
    Source code(tar.gz)
    Source code(zip)
  • v5.8.2(Jun 10, 2022)

  • v5.8.1(Jun 8, 2022)

    (no changes in this release due a build-process error, please see https://github.com/plotly/plotly.py/releases/tag/v5.8.2 for the changes that were initially reported to be in this build)

    Source code(tar.gz)
    Source code(zip)
  • v5.8.0(May 11, 2022)

    See the full release announcement on the forum at https://community.plotly.com/t/announcing-plotly-py-5-8-0-better-autocompletions-with-type-hints-minor-ticks/64002 !

    Fixed

    • Improve support for type checking and IDE auto-completion by bypassing lazy-loading when type checking. #3425 with thanks to @JP-Ellis
    • line dash-style validators are now correctly used everywhere so that values like 10px 2px are accepted #3722
    • Resolved various deprecation warning messages and compatibility issues with upstream dependencies and Python 3.11, plus removed dependency on six, with thanks to @maresb, @hugovk, @tirkarthi, @martinRenou, and @BjoernLudwigPTB
    • Better support for MathJax 3 #3706

    Added

    • Type annotations for Plotly Express functions and chainable go.Figure methods, for better IDE auto-completion #3708

    Updated

    • Updated Plotly.js to from version 2.11.1 to version 2.12.1. See the plotly.js CHANGELOG for more information. Notable changes include:
      • Add minor ticks to cartesian axes
      • Add griddash option to most axes
    Source code(tar.gz)
    Source code(zip)
  • v5.7.0(Apr 5, 2022)

    See the full release announcement here: https://community.plotly.com/t/announcing-plotly-py-5-7-0-text-on-histograms-and-heatmaps-patterns-on-areas-plotly-js-version-number-access-smith-charts/62735

    Added

    • added pattern_shape options to px.area() #3668

    Updated

    • Updated Plotly.js to from version 2.9.0 to version 2.11.1. See the plotly.js CHANGELOG for more information. Notable changes include:
      • Add fillpattern options to scatter trace
      • Various JS-specific improvements such as MathJax 3.0 support
    Source code(tar.gz)
    Source code(zip)
  • v5.6.0(Feb 9, 2022)

    Updated

    • Updated Plotly.js to from version 2.8.3 to version 2.9.0. See the plotly.js CHANGELOG for more information. Notable changes include:
      • Implement ticklabelstep to reduce labels on cartesian axes and colorbars
      • Display the version of plotly.js when hovering over the modebar
    Source code(tar.gz)
    Source code(zip)
  • v5.5.0(Dec 21, 2021)

    Added

    • text_auto argument to px.bar, px.histogram, px.density_heatmap, px.imshow #3518
    • Deprecated ff.create_annotated_heatmap, ff.create_county_choropleth, ff.create_gantt #3518
    • div_id argument to pio.to_html, pio.write_html, fig.to_html and fig.write_html to optionally make its IDs deterministic #3487 with thanks to @Skn0tt

    Fixed

    • Fixed ValueError when ff.create_annotated_heatmap passes rgba() colors into to_rgb_color_list #3478 with thanks to @janosh

    Updated

    • Updated Plotly.js to from version 2.6.3 to version 2.8.3. See the plotly.js CHANGELOG for more information. Notable changes include:
      • Horizontal color bars
      • texttemplate for histogram-like and heatmap-like traces
    Source code(tar.gz)
    Source code(zip)
  • v5.4.0(Nov 15, 2021)

    Fixed

    • Fixed error when serializing dict with mix of string and non-string keys #3380

    Updated

    • The JSON serialization engines no longer sort their keys #3380
    • Updated Plotly.js to from version 2.4.2 to version 2.6.3. See the plotly.js CHANGELOG for more information. Notable changes include:
      • New subplot type smith that supports scattersmith trace types for visualizing data in the complex domain
      • Changes to Plotly.js packaging
    Source code(tar.gz)
    Source code(zip)
  • v5.3.1(Sep 1, 2021)

    Updated

    Updated Plotly.js to from version 2.4.1 to version 2.4.2. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:

    • Bug fix for rendering unified hover labels in classic Jupyter Notebooks
    Source code(tar.gz)
    Source code(zip)
  • v5.3.0(Aug 30, 2021)

    • Updated Plotly.js to from version 2.3.1 to version 2.4.1. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:
      • Added legend.groupclick options
      • Provide bbox of hover items in event data
    Source code(tar.gz)
    Source code(zip)
  • v5.2.2(Aug 23, 2021)

  • v5.2.1(Aug 14, 2021)

    See the full release announcement here: https://community.plotly.com/t/announcing-plotly-py-5-2-1-trendlines-ecdf-plots-markers-on-lines-sharper-webgl-legend-group-titles/55681

    Updated

    • Updated Plotly.js to from version 2.2.0 to version 2.3.1. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:
      • new projections in geo subplots from a more recent version of d3-geo
      • new number-formatting directives from a more recent version of d3-format
      • Improve rendering of scattergl, splom and parcoords by implementing plotGlPixelRatio for those traces
      • performance improvements and bug fixes

    Added

    • Extra flags were added to the gapminder and stocks dataset to facilitate testing, documentation and demos #3305
    • All line-like Plotly Express functions now accept markers argument to display markers, and all but line_mapbox accept symbol to map a field to the symbol attribute, similar to scatter-like functions #3326
    • px.scatter and px.density_contours now support new trendline types 'rolling', 'expanding' and 'ewm' #2997
    • px.scatter and px.density_contours now support new trendline_options argument to parameterize trendlines, with support for constant control and log-scaling in 'ols' and specification of the fraction used for 'lowess', as well as pass-through to Pandas for 'rolling', 'expanding' and 'ewm' #2997
    • px.scatter and px.density_contours now support new trendline_scope argument that accepts the value 'overall' to request a single trendline for all traces, including across facets and animation frames #2997
    • A new px.ecdf() function for Empirical Cumulative Distribution Functions #3330

    Fixed

    • Fixed regression introduced in version 5.0.0 where pandas/numpy arrays with dtype of Object were being converted to list values when added to a Figure (#3292, #3293)
    • Better detection of Chrome and Chromium browsers in the Renderers framework, especially on Linux (#3278) with thanks to @c-chaitanya for the contribution
    Source code(tar.gz)
    Source code(zip)
  • v5.1.0(Jun 28, 2021)

    • Updated Plotly.js from version 2.1.0 to version 2.2.0. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:
      • new <trace>.legendgrouptitle attribute for legend group titles
      • new %h text formatting directive for half-years
      • performance improvements and bug fixes
    Source code(tar.gz)
    Source code(zip)
  • v5.0.0(Jun 21, 2021)

    See the full release announcement here: https://community.plotly.com/t/introducing-plotly-py-5-0-0-a-new-federated-jupyter-extension-icicle-charts-and-bar-chart-patterns/54039

    Updated/Changed

    Items in this section may be considered backwards-incompatible changes for the purposes of Semantic Versioning but we expect the vast majority of users to be able to upgrade to version 5.0 without encountering any issues.

    • Dropped support for Python older than 3.6 #3160
    • Updated Plotly.js to from version 1.58.4 to version 2.1.0. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:
      • dropped support for IE9 and IE10
      • dropped support for long-deprecated graph_objects like area traces and scatter.(t|r) and layout.(radial|angular)axis attributes
      • modebar no longer has hovermode or spikeline buttons by default (can be added back with fig.update_layout(modebar_add=["v1hovermode", "toggleSpikeLines"]))
      • "Aa" text no longer appears on legend items unless mode="text"
      • In bar traces, textposition now defaults to "auto"
      • Font size for legend and colorbar titles now matches axis title font size (slightly bigger)
      • deprecated heatmapgl, pointcloud traces as well as all transform attributes
    • Combined plotlywidget into jupyterlab-plotly and packaged them as a federated extension #3142 with massive thanks to @fcollonval for the contribution
      • In addition to this change, large Plotly.js bundles are now lazily loaded on-demand by JupyterLab
    • Plotly.js CDN url will now be versioned by default for HTML exports using include_plotlyjs='cdn' and for "connected" renderers. #2961 with thanks to @adehad for the contribution
    • Recommending Kaleido by default over Orca #3094
    • Replaced retrying dependency with tenacity #2911 with thanks to @jmsmdy for the contribution
    • Plotly Express now always takes into account every value in category_orders when computing discrete mappings (color, symbol, line-dash, pattern-shapes) as well as facets, even those values which are absent in the data #3247

    Added

    • Additions due to bumping Plotly.js from 1.58.4 to 2.1.0 (see changelog):
      • New icicle trace type, with thanks to @Kully and @mtwichan of Zyphr for their contribution!
      • New marker.pattern options for bar-like trace types with thanks to @s417-lama for the contribution!
      • New legendrank attribute to control rank of traces within legends
    • Plotly Express' px.bar(), px.histogram() and px.bar_polar() now support the pattern_shape argument #3252
    • New Plotly Express px.icicle() function, with thanks to @Kully and @mtwichan of Zyphr for their contribution! #3256
    • New functions in plotly.colors: get_colorscale() and sample_colorscale() #3136 and #3186 with thanks to @CarlAndersson for the contributions
    • Faster JSON encoding when orjson is present #2955

    Fixed

    • Pandas and Numpy datetime serialization fixes #3022
    • Fixed selected points of histograms in FigureWidget #2771 with thanks to @meffmadd for the contribution
    • Static image export now honors layout.(width|height)#3240
    • Improvements to "matplotlylib" conversion utility in plotly.tools.mpl_to_plotly() with thanks to @fdion #3143
    Source code(tar.gz)
    Source code(zip)
  • v5.0.0rc2(Jun 7, 2021)

    Find out more about the RC process on our Forum: https://community.plotly.com/t/plotly-py-5-0-is-coming-soon-try-the-release-candidate-today/53470

    Updated

    • Updated Plotly.js to version 2.0.0. See the plotly.js 2.0.0 CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:
      • new marker.pattern options for bar-like trace types
      • dropped support for IE9 and IE10
      • dropped support for long-deprecated graph_objects like area traces and scatter.(t|r) and layout.(radial|angular)axis attributes
      • deprecated heatmapgl, pointcloud traces as well as all transform attributes
    • Combined plotlywidget into jupyterlab-plotly and packaged them as a federated extension #3142 with massive thanks to @fcollonval for the contribution
    • Plotly.js CDN url will now be versioned by default for HTML exports using include_plotlyjs='cdn' and for "connected" renderers. #2961 with thanks to @adehad for the contribution
    • Dropped support for Python older than 3.6 #3160
    • Recommending Kaleido by default over Orca #3094
    • Replaced retrying dependency with tenacity #2911 with thanks to @jmsmdy for the contribution

    Added

    • New functions in plotly.colors: get_colorscale() and sample_colorscale() #3136 and #3186 with thanks to @CarlAndersson for the contributions
    • Faster JSON encoding when orjson is present #2955

    Fixed

    • Pandas and Numpy datetime serialization fixes #3022
    • Fixed selected points of histograms in FigureWidget #2771 with thanks to @meffmadd for the contribution
    Source code(tar.gz)
    Source code(zip)
  • v5.0.0rc1(Jun 7, 2021)

    Find out more about the RC process on our Forum: https://community.plotly.com/t/plotly-py-5-0-is-coming-soon-try-the-release-candidate-today/53470

    Updated

    • Updated Plotly.js to version 2.0.0-rc.2. See the plotly.js 2.0.0 CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:
      • new marker.pattern options for bar-like trace types
      • dropped support for IE9 and IE10
      • dropped support for long-deprecated graph_objects like area traces and scatter.(t|r) and layout.(radial|angular)axis attributes
      • deprecated heatmapgl, pointcloud traces as well as all transform attributes
    • Combined plotlywidget into jupyterlab-plotly and packaged them as a federated extension #3142 with massive thanks to @fcollonval for the contribution
    • Plotly.js CDN url will now be versioned by default for HTML exports using include_plotlyjs='cdn' and for "connected" renderers. #2961 with thanks to @adehad for the contribution
    • Dropped support for Python older than 3.6 #3160
    • Recommending Kaleido by default over Orca #3094
    • Replaced retrying dependency with tenacity #2911 with thanks to @jmsmdy for the contribution

    Added

    • New functions in plotly.colors: get_colorscale() and sample_colorscale() #3136 and #3186 with thanks to @CarlAndersson for the contributions
    • Faster JSON encoding when orjson is present #2955

    Fixed

    • Pandas and Numpy datetime serialization fixes #3022
    • Fixed selected points of histograms in FigureWidget #2771 with thanks to @meffmadd for the contribution
    Source code(tar.gz)
    Source code(zip)
  • v4.14.3(Jan 12, 2021)

  • v4.14.2(Jan 11, 2021)

    Updated

    • JupyterLab extensions now compatible with JupyterLab 3.x 3016
    • Updated Plotly.js to version 1.58.4. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:
      • fixes for rendering 3d plots on recent Safari versions
      • fixes to inside ticklabels
      • regression fixes

    Fixed

    • px.histogram() Y-axis labels now take into account histnorm and barnorm 2989
    • px.histogram() marginal and facet_* now work correctly together 3014
    Source code(tar.gz)
    Source code(zip)
  • v4.14.1(Dec 9, 2020)

    See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-14-faceted-and-animated-images-and-heatmaps-inside-tick-labels-better-axis-type-detection/48079

    Updated

    • Updated Plotly.js to version 1.58.2. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:
      • fixes for new ticklabelposition attribute
      • fixes for a regression related to treemaps in the previous version
    Source code(tar.gz)
    Source code(zip)
  • v4.14.0(Dec 7, 2020)

    See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-14-faceted-and-animated-images-and-heatmaps-inside-tick-labels-better-axis-type-detection/48079

    Added

    • px.imshow now supports facet_col and animation_frame arguments for visualizing 3-d and 4-d images 2746
    • px.defaults now supports color_discrete_map, symbol_map, line_dash_map, labels and category_orders as well as a .reset() method 2957

    Fixed

    • axes will now auto-type numeric strings as categorical data rather than linear in the default templates 2951

    Updated

    • Updated Plotly.js to version 1.58.1. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module. Notable changes include:
      • a new ticklabelposition attribute to enable positioning tick labels inside the plotting area
      • better support for scaleanchor and matches on cartesian axes for matched square subplots
      • a new autotypenumbers attribute which is now set to strict in the default templates
      • various fixes relating to automargins for small figures
    Source code(tar.gz)
    Source code(zip)
  • v4.13.0(Nov 23, 2020)

    See the fully release announcement at https://community.plotly.com/t/announcing-plotly-py-4-13-magical-error-messages-and-documentation-plus-speedups-and-faceted-maps/47497

    Added

    • px.choropleth, px.scatter_geo and px.line_geo now support faceting as well as fitbounds and basemap_visible 2923
    • px.scatter_geo and px.line_geo now support geojson/featureidkey input 2923
    • px.scatter_geo now supports symbol 2923
    • go.Figure now has a set_subplots method to set subplots on an already existing figure. 2866
    • Added Turbo colorscale and fancier swatch display functions 2882
    • A utility function image_array_to_data_uri has been added in plotly.utils, in order to transform NumPy arrays to data b64 URIs (which can be passed to the source parameter of go.Image, or to layout images). 2879
    • the selector argument to updater/selector functions now accepts ints and strs 2894

    Updated

    • the JSON serialization of plotly figures has been accelerated thanks to a different handling of Infinity and NaN values. For example, a figure with a 1000x1000 Heatmap should now serialize 2x faster. 2880
    • Coding mistakes with "magic underscores" now return significantly more ergonomic error messages 2843
    • Error messages related to impossible subplot geometries are now much more helpful 2897

    Fixed

    • px.scatter_geo support for text is fixed 2923
    • the x and y parameters of px.imshow are now used also in the case where an Image trace is used (for RGB data or with binary_string=True). However, only numerical values are accepted (while the Heatmap trace allows date or string values for x and y). 2761
    Source code(tar.gz)
    Source code(zip)
  • v4.12.0(Oct 23, 2020)

    See the full release announcement at https://community.plotly.com/t/announcing-plotly-py-4-12-horizontal-and-vertical-lines-and-rectangles/46783

    Added

    • For add_trace, add_shape, add_annotation and add_layout_image, the row and/or col argument now also accept the string "all". row="all" adds the object to all the subplot rows and col="all" adds the object to all the subplot columns. (#2840)
    • Shapes that reference the plot axes in one dimension and the data in another dimension can be added with the new add_hline, add_vline, add_hrect, add_vrect functions, which also support the row="all" and col="all" arguments. (#2840)
    • The add_trace, add_shape, add_annotation, add_layout_image, add_hline, add_vline, add_hrect, add_vrect functions accept an argument exclude_empty_subplots which if True, only adds the object to subplots already containing traces or layout objects. This is useful in conjunction with the row="all" and col="all" arguments. (#2840)
    • For all go.Figure functions accepting a selector argument (e.g., select_traces), this argument can now also be a function which is passed each relevant graph object (in the case of select_traces, it is passed every trace in the figure). For graph objects where this function returns true, the graph object is included in the selection. (#2844)

    Updated

    • Updated Plotly.js to version 1.57.1. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module.
    Source code(tar.gz)
    Source code(zip)
  • v4.11.0(Oct 1, 2020)

    See the full release announcement at https://community.plotly.com/t/announcing-plotly-py-4-12-horizontal-and-vertical-lines-and-rectangles/46783

    Updated

    • Updated Plotly.js to version 1.56.0. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module.
    Source code(tar.gz)
    Source code(zip)
  • v4.10.0(Sep 10, 2020)

    See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-10-date-axis-improvements-a-faster-px-imshow-and-full-figures-for-development/44685

    Added

    • Added plotly.io.full_figure_for_development() and plotly.graph_objects.Figure.full_figure_for_development() (#2737)

    Updated

    • Updated Plotly.js to version 1.55.2. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects module.
    • px.imshow has a new binary_string boolean argument, which passes the image data as a b64 binary string when True. Using binary strings allow for faster image rendering and smaller figure size. Additional optional arguments binary_backend, binary_format and binary_compression_level control how to generate the b64 string (#2691
    • px.imshow has a new constrast_rescaling argument in order to choose how to set data values corresponding to the bounds of the color range (#2691

    Fixed

    • Plotly Express no longer converts datetime columns of input dataframes to UTC (#2749)
    • Plotly Express has more complete support for datetimes as additional hover_data (#2749)
    • Histogram selection behaviour with FigureWidget (#2711) with thanks to @meffmadd
    • Behaviour of full_html() with html=False (#2469) with thanks to @tallamjr
    • ff.distplot() now only computes traces that will be shown (#2730) with thanks to @akbo
    • Pandas backend .hist() works with latest version of Pandas (#2713) with thanks to @Kerybas
    Source code(tar.gz)
    Source code(zip)
  • v4.9.0(Jul 16, 2020)

    See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-9-kaleido-for-static-image-export-hexbin-tile-maps-and-timelines/42524

    Added

    • Added image export support using Kaleido. The image export backend can be configured using the new engine argument to plotly.io.to_image and plotly.io.write_image. The engine argument may be set to "kaleido", "orca", or "auto". The default is engine="auto", in which case the Kaleido backend is enabled if the kaleido package from PyPI is installed, otherwise Orca is used. (#2613).
    • plotly.express.timeline() added as an official alternative to plotly.figure_factories.create_gantt() (#2626)
    • create_hexbin_mapbox() added to Figure Factories, with thanks to @RenaudLN for the impressive contribution!
    • facet_row_spacing and facet_col_spacing added to Plotly Express cartesian 2d functions (#2614)
    • base added to Plotly Express bar and bar_polar functions (#2626)
    • px.NO_COLOR constant to override wide-form color assignment in Plotly Express (#2614)

    Fixed

    • trendline traces are now of type scattergl when render_mode="webgl" in Plotly Express (#2614)
    • regression from 4.8.1 whereby "parent" was not accepted as part of path for px.sunburst() and px.treemap() (#2640)
    • create_dendrogram() figure factory now works correctly with scipy 1.5.1 (#2627)

    Updated

    • Updated Plotly.js to version 1.54.6. See the plotly.js CHANGELOG for more information.
    • Added all cartesian-2d Plotly Express functions, plus imshow, to Pandas backend with kind option (#2541)
    • plotly.express.imshow now uses data frame index and columns names and values to populate axis parameters by default (#2539)
    • Javascript extensions are now build using Node 12, and have an updated package-lock.json with many fewer security warnings (#2636)
    Source code(tar.gz)
    Source code(zip)
  • v4.8.2(Jun 26, 2020)

    See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-8-plotly-express-support-for-wide-and-mixed-form-data-plus-a-pandas-backend/40048

    Updated

    • Updated Plotly.js to version 1.54.5. See the plotly.js CHANGELOG for more information. This version includes various bug and security fixes.
    • add_traces() now accepts bare int-like values for rows/cols as well as lists thereof (#2546), with thanks to @MCBoarder289 for the contribution!

    Fixed

    • row/col now accept int-like values, not strictly int values (#2451), with thanks to @MCBoarder289 for the contribution!
    • Fixed special cases with px.sunburst and px.treemap with path input (#2524)
    • Fixed bug in hover_data argument of px functions, when the column name is changed with labels and hover_data is a dictionary setting up a specific format for the hover data (#2544).
    • Made the Plotly Express trendline argument more robust and made it work with datetime x values (#2554)
    • Fixed bug in px.sunburst and px.treemap: when the color and values arguments correspond to the same column, a different aggregation function has to be used for the two arguments (#2591)
    • Plotly Express wide mode now accepts mixed integer and float columns (#2598)
    • Plotly Express range_(x|y) should not impact the unlinked range of marginal subplots (#2600)
    • px.line now sets line_group=<variable> in wide mode by default (#2599)
    • Corrected some regex warnings (#2577), with thanks to @georgevdd for the contribution!
    Source code(tar.gz)
    Source code(zip)
  • v4.8.1(May 29, 2020)

    See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-8-plotly-express-support-for-wide-and-mixed-form-data-plus-a-pandas-backend/40048

    Fixed

    • Fixed the accidental removal of some functions and submodules from plotly.colors and plotly.express.colors
    Source code(tar.gz)
    Source code(zip)
  • v4.8.0(May 26, 2020)

    See the full announcement at https://community.plotly.com/t/announcing-plotly-py-4-8-plotly-express-support-for-wide-and-mixed-form-data-plus-a-pandas-backend/40048

    Key new documentation pages:

    Added

    • plotly now provides a Plotly Express-backed Pandas-compatible plotting backend, which can be activated via pandas.options.plotting.backend = "plotly". Note that it is not intended to implement every Pandas plotting function, nor is it intended to replicate the behaviour of every argument, although per the changes below, x and y should behave similarly. (#2336)
    • New datasets have been added to plotly.express.data: stocks, experiment, medals_wide and medals_long. (#2336)
    • plotly go.Figure and go.FigureWidget now have a _repr_html_ and a _repr_mimebundle_ method, which are standard hooks for integration in systems based on IPython. In particular, with _repr_html_ plotly figures can now be used within sphinx-gallery without any scraper. These additions should not change anything to the way plotly figures are displayed in notebook environments, since the _ipython_display_ method (already present in earlier versions) takes precedence over the new methods.

    Updated

    • The behaviour of the x, y, orientation, histfunc, violinmode, boxmode and stripmode arguments for 2d-cartesian functions in Plotly Express (i.e. scatter, line, area, bar, histogram, violin, box, strip, funnel, density_heatmap and density_contour) has been refined (#2336):
      • wide-form data support: if either x or y (but not both) may now be provided as a list of column references into data_frame or columns of data, in which case the imputed data frame will be treated as "wide" data and melt()ed internally before applying the usual mapping rules, with function-specific defaults.
      • if neither x nor y is provided but data_frame is, the data frame will be treated as "wide" with defaults depending on the value of orientation (and orientation has accordingly been added to scatter, line, density_heatmap, and density_contour for this purpose). Previously this would have resulted in an empty figure.
      • if x or y is missing, it is inferred to be the index of data_frame if data_frame provided, otherwise a stable index of integers starting at 0. In the case of px.bar, if the provided value is not continuous, the missing value is treated as a column of 1s named "count", so as to behave more like px.histogram and to avoid sizing the resulting bars differently based on their position in the column. Previously, missing values defaulted to integers starting at 0 per trace which made it potentially inconsistent or misleading.
      • if x (y) is missing, orientation now defaults to v (h). Previously it always defaulted to v but this is not considered a breaking change, as the cases in which it now defaults to h caused unreadable output if set to v.
      • if both x and y are provided and one of them does not contain continuous values, orientation defaults to the value perpendicular to that axis. Previously it always defaulted to v but this is not considered a breaking change, as the cases in which it now defaults to h caused unreadable output if set to v.
      • if both x and y are provided to histogram, and if x, y and z are provided to density_heatmap or density_contour, then histfunc now defaults to sum so as to avoid ignoring the provided data, and to cause histogram and bar to behave more similarly.
      • violinmode, boxmode and stripmode now default to overlay if x (y) in in v (h) orientation is also mapped to color, to avoid strange spacing issues with the previous default of group in all cases.
    • The Plotly Express arguments color_discrete_map, symbol_map and line_dash_map now accept the string "identity" which causes the corresponding input data to be used as-is rather than mapped into color_discrete_sequence, symbol_sequence or line_dash_sequence, respectively. (#2336)
    • Plotly Express now accepts px.Constant or px.Range objects in the place of column references so as to express constant or increasing integer values. (#2336)
    Source code(tar.gz)
    Source code(zip)
  • v4.7.1(May 8, 2020)

    Fixed

    • Fix AttributeError: module 'plotly.graph_objs' has no attribute 'FigureWidget' exception on from plotly.graph_objs import * when ipywidgets is not installed. Error also occurred when importing plotly.figure_factor. It is now possible to import plotly.graph_objs.FigureWidget when ipywidgets is not installed, and an informative ImportError exception will be raised in the FigureWidget constructor (#2443, #1111).
    • Fix TypeError: unhashable type: 'Template' during Figure construction when plotly.io.templates.default is set to a Template object rather than a string.
    Source code(tar.gz)
    Source code(zip)
  • v4.7.0(May 6, 2020)

    Updated

    • Updated Plotly.js to version 1.54.1. See the plotly.js CHANGELOG for more information. The main new feature of this version of Plotly.js is the possibility to draw layout shapes, using custom dragmodes and corresponding modebar buttons.
    • The sphinx-gallery scraper has been updated to work with different structures of galleries #2149

    Added

    • The hover_data parameter of px functions can now be a dictionary. This makes it possible to skip hover information for some arguments or to change the formatting of hover informatiom #2377.
    • It's now possible to build a development version of Plotly.py against the build artifacts from a non-master branch of Plotly.js, which makes for faster QA and development cycles #2349. Thanks @zouhairm for this Pull Request!

    Fixed

    • Plotly Express trendlines now handle missing data correctly #2357

    Performance

    This version includes several performance improvements (#2368, #2403).

    • Child graph objects (e.g. figure.layout.xaxis) are no longer created eagerly during graph object construction. Instead, they are created lazily the first time the property is accessed.
    • Property validation is now disabled for select internal operations.
    • When used with Python 3.7 and above, ploty.py now takes advantage of PEP-562 to perform submodule imports lazily. This dramatically improves import times.
    Source code(tar.gz)
    Source code(zip)
Plotly Dash Command Line Tools - Easily create and deploy Plotly Dash projects from templates

??️ dash-tools - Create and Deploy Plotly Dash Apps from Command Line | | | | | Create a templated multi-page Plotly Dash app with CLI in less than 7

Andrew Hossack 29 Jul 22, 2022
Graphing communities on Twitch.tv in a visually intuitive way

VisualizingTwitchCommunities This project maps communities of streamers on Twitch.tv based on shared viewership. The data is collected from the Twitch

Kiran Gershenfeld 293 Aug 12, 2022
A dashboard built using Plotly-Dash for interactive visualization of Dex-connected individuals across the country.

Dashboard For The DexConnect Platform of Dexterity Global Working prototype submission for internship at Dexterity Global Group. Dashboard for real ti

Yashasvi Misra 2 Jun 15, 2021
Custom Plotly Dash components based on Mantine React Components library

Dash Mantine Components Dash Mantine Components is a Dash component library based on Mantine React Components Library. It makes it easier to create go

Snehil Vijay 159 Aug 8, 2022
A curated list of awesome Dash (plotly) resources

Awesome Dash A curated list of awesome Dash (plotly) resources Dash is a productive Python framework for building web applications. Written on top of

Luke Singham 1.6k Aug 8, 2022
Productivity Tools for Plotly + Pandas

Cufflinks This library binds the power of plotly with the flexibility of pandas for easy plotting. This library is available on https://github.com/san

Jorge Santos 2.6k Jul 29, 2022
Productivity Tools for Plotly + Pandas

Cufflinks This library binds the power of plotly with the flexibility of pandas for easy plotting. This library is available on https://github.com/san

Jorge Santos 2.1k Feb 18, 2021
A Simple Flask-Plotly Example for NTU 110-1 DSSI Class

A Simple Flask-Plotly Example for NTU 110-1 DSSI Class Live Demo Prerequisites We will use Flask and Ploty to build a Flask application. If you haven'

Ting Ni Wu 1 Dec 11, 2021
Peloton Stats to Google Sheets with Data Visualization through Seaborn and Plotly

Peloton Stats to Google Sheets with Data Visualization through Seaborn and Plotly Problem: 2 peloton users were looking for a way to track their metri

null 9 Jul 22, 2022
A shimmer pre-load component for Plotly Dash

dash-loading-shimmer A shimmer pre-load component for Plotly Dash Installation Get it with pip: pip install dash-loading-extras Or maybe you prefer Pi

Lucas Durand 3 Feb 16, 2022
Regress.me is an easy to use data visualization tool powered by Dash/Plotly.

Regress.me Regress.me is an easy to use data visualization tool powered by Dash/Plotly. Regress.me.-.Google.Chrome.2022-05-10.15-58-59.mp4 Get Started

Amar 14 Jul 29, 2022
Interactive Data Visualization in the browser, from Python

Bokeh is an interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics, and affords hi

Bokeh 16.6k Aug 13, 2022
Interactive Data Visualization in the browser, from Python

Bokeh is an interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics, and affords hi

Bokeh 14.7k Feb 13, 2021
Interactive Data Visualization in the browser, from Python

Bokeh is an interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics, and affords hi

Bokeh 14.7k Feb 18, 2021
Easily convert matplotlib plots from Python into interactive Leaflet web maps.

mplleaflet mplleaflet is a Python library that converts a matplotlib plot into a webpage containing a pannable, zoomable Leaflet map. It can also embe

Jacob Wasserman 497 Aug 2, 2022
An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden.

sweden-rent-dashboard An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden. The dashboard/web

Rory Crean 5 Dec 19, 2021
An interactive GUI for WhiteboxTools in a Jupyter-based environment

whiteboxgui An interactive GUI for WhiteboxTools in a Jupyter-based environment GitHub repo: https://github.com/giswqs/whiteboxgui Documentation: http

Qiusheng Wu 93 Jul 6, 2022
Draw interactive NetworkX graphs with Altair

nx_altair Draw NetworkX graphs with Altair nx_altair offers a similar draw API to NetworkX but returns Altair Charts instead. If you'd like to contrib

Zachary Sailer 198 Jul 25, 2022
Interactive plotting for Pandas using Vega-Lite

pdvega: Vega-Lite plotting for Pandas Dataframes pdvega is a library that allows you to quickly create interactive Vega-Lite plots from Pandas datafra

Altair 341 Jun 9, 2022