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.

Comments
  • [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
  • Bump json5 from 1.0.1 to 1.0.2 in /packages/javascript/jupyterlab-plotly

    Bump json5 from 1.0.1 to 1.0.2 in /packages/javascript/jupyterlab-plotly

    Bumps json5 from 1.0.1 to 1.0.2.

    Release notes

    Sourced from json5's releases.

    v1.0.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295). This has been backported to v1. (#298)
    Changelog

    Sourced from json5's changelog.

    Unreleased [code, diff]

    v2.2.3 [code, diff]

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1 [code, diff]

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0 [code, diff]

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

    v2.1.3 [code, diff]

    • Fix: An out of memory bug when parsing numbers has been fixed. (#228, #229)

    v2.1.2 [code, diff]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies javascript 
    opened by dependabot[bot] 0
  • Can the points be shown inside of the violin area?

    Can the points be shown inside of the violin area?

    One of my favorite types of plots to show distributions is to use Sina plots where the points are spread out within the area of the violin representing the density of the distribution. I then additionally overlay this with a boxplot as is already possible in plotly. So my questions/feature requests are then:

    1. Can the points of a violin plot be shown inside of the violin rather than next to it?
    2. Is it possible to have the points be spread out to the width of the violin as in the Sina plots?

    Thank you for your consideration.

    opened by Midnighter 0
  • Bug using the underscore notation for annotation attributes, coupled with buttons

    Bug using the underscore notation for annotation attributes, coupled with buttons

    Hi, I just had trouble with the following example:

    fig.update_layout(
                updatemenus=[
                    dict(
                        type="buttons",
                        buttons=[
                            dict(
                                label="All",
                                method="update",
                                args=[
                                    {"visible": [True] * 9},  # show all traces
                                    {
                                        "annotations": [inner_annotation]
                                    },
                                ],
                            ),
                        ],
                    )
                ]
            )
    

    Everything works fine on the figure load, however, clicking on the button would change the font_size of my annotation back to default, whereas I set it on 16.

    inner_annotation = dict(
                ...
               font_size=16,
            )
    

    After some tests I figured out changing the syntax to

    inner_annotation = dict(
                ...
               font={"size": 16},
            )
    

    resolved the issue.

    opened by sde-cdsp 0
  • Allow setting the camera

    Allow setting the camera "field of view"

    It doesn't seem possible to set the 3D camera field of view (fov).

    (Re: my post to Stackoverflow.)

    Looking at the source code, I see that:

    In https://github.com/plotly/plotly.js/blob/master/src/plots/gl3d/scene.js, it uses glPlot3d.createScene and sets the options in proto.prepareOptions.

    In https://github.com/gl-vis/gl-plot3d/blob/master/scene.js#L179, the allowed options include the field-of-view parameter fovy (field-of-view in the vertical direction), which defaults to Math.PI/4 (45 degrees).

    For 3D graphics, a 45-degree vertical field-of-view typically gives an exaggerated perspective. It corresponds to about a 28mm camera lens.

    It would be nice for plotly.graph_objects.layout.scene.Camera to include a fovy parameter (in radians).

    opened by hhoppe 0
  • languages RTL direction issue fig.write_image

    languages RTL direction issue fig.write_image "jpeg"

    The issue with export chart to jpeg in languages right to left direction (arbic -hebrew -urdu) ,when using command "fig.write_image".

    to export to .html no issue and all brackets are ok but to export to image jpg the brackets are missed up.

    HTML ver

    jpeg ver

    opened by iMuaad 0
Releases(v5.11.0)
  • v5.11.0(Oct 27, 2022)

    Updated

    • Updated Plotly.js to from version 2.14.0 to version 2.16.1. See the plotly.js CHANGELOG for more information. Notable changes include:
      • Add clustering options to scattermapbox [#5827], with thanks to @elben10 for the contribution!
      • Add bounds to mapbox suplots [6339]
      • Add angle, angleref and standoff to marker and add backoff to line; also introduce new arrow symbols to facilitate drawing networks [#6297]
      • Add minreducedwidth and minreducedheight to layout for increasing control over automargin [#6307]
      • Add entrywidth and entrywidthmode to legend [#6202, #6324]
    Source code(tar.gz)
    Source code(zip)
  • v5.10.0(Aug 11, 2022)

    Updated

    • Updated Plotly.js to from version 2.12.1 to version 2.14.0. See the plotly.js CHANGELOG for more information. Notable changes include:
      • Add support for sankey links with arrows
      • Add selections, newselection and activeselection layout attributes to have persistent and editable selections over cartesian subplots
      • Add unselected.line.color and unselected.line.opacity options to parcoords trace
      • Display Plotly's new logo in the modebar
    Source code(tar.gz)
    Source code(zip)
  • 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)
基于python爬虫爬取COVID-19爆发开始至今全球疫情数据并利用Echarts对数据进行分析与多样化展示。

COVID-19-Epidemic-Map 基于python爬虫爬取COVID-19爆发开始至今全球疫情数据并利用Echarts对数据进行分析与多样化展示。 觉得项目还不错的话欢迎给一个star! 项目的源码可以正常运行,各个库的版本、数据库的建表语句、运行过程中遇到的坑以及解决方式在笔记.md中都

31 Dec 15, 2022
Sky attention heatmap of submissions to astrometry.net

astroheat Installation Requires Python 3.6+, Tested with Python 3.9.5 Install library dependencies pip install -r requirements.txt The program require

4 Jun 20, 2022
Gallery of applications built using bqplot and widget libraries like ipywidgets, ipydatagrid etc.

bqplot Gallery This is a gallery of bqplot examples. View the gallery at https://bqplot.github.io/bqplot-gallery. Contributing new examples Clone this

8 Aug 23, 2022
Flexitext is a Python library that makes it easier to draw text with multiple styles in Matplotlib

Flexitext is a Python library that makes it easier to draw text with multiple styles in Matplotlib

Tomás Capretto 93 Dec 28, 2022
ICS-Visualizer is an interactive Industrial Control Systems (ICS) network graph that contains up-to-date ICS metadata

ICS-Visualizer is an interactive Industrial Control Systems (ICS) network graph that contains up-to-date ICS metadata (Name, company, port, user manua

QeeqBox 2 Dec 13, 2021
TensorDebugger (TDB) is a visual debugger for deep learning. It extends TensorFlow with breakpoints + real-time visualization of the data flowing through the computational graph

TensorDebugger (TDB) is a visual debugger for deep learning. It extends TensorFlow (Google's Deep Learning framework) with breakpoints + real-time visualization of the data flowing through the comput

Eric Jang 1.4k Dec 15, 2022
Kglab - an abstraction layer in Python for building knowledge graphs

Graph Data Science: an abstraction layer in Python for building knowledge graphs, integrated with popular graph libraries – atop Pandas, RDFlib, pySHACL, RAPIDS, NetworkX, iGraph, PyVis, pslpython, p

derwen.ai 466 Jan 09, 2023
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.7k Dec 26, 2022
Python package for the analysis and visualisation of finite-difference fields.

discretisedfield Marijan Beg1,2, Martin Lang2, Samuel Holt3, Ryan A. Pepper4, Hans Fangohr2,5,6 1 Department of Earth Science and Engineering, Imperia

ubermag 12 Dec 14, 2022
a robust room presence solution for home automation with nearly no false negatives

Argos Room Presence This project builds a room presence solution on top of Argos. Using just a cheap raspberry pi zero w (plus an attached pi camera,

Angad Singh 46 Sep 18, 2022
A Graph Learning library for Humans

A Graph Learning library for Humans These novel algorithms include but are not limited to: A graph construction and graph searching class can be found

Richard Tjörnhammar 1 Feb 08, 2022
An easy to use burndown chart generator for GitHub Project Boards.

Burndown Chart for GitHub Projects An easy to use burndown chart generator for GitHub Project Boards. Table of Contents Features Installation Assumpti

Joseph Hale 15 Dec 28, 2022
A simple agent-based model used to teach the basics of OOP in my lectures

Pydemic A simple agent-based model of a pandemic. This is used to teach basic principles of object-oriented programming to master students. It is not

Fabien Maussion 2 Jun 08, 2022
Learn Data Science with focus on adding value with the most efficient tech stack.

DataScienceWithPython Get started with Data Science with Python An engaging journey to become a Data Scientist with Python TL;DR Download all Jupyter

Learn Python with Rune 110 Dec 22, 2022
A comprehensive tutorial for plotting focal mechanism

Focal_Mechanisms_Demo A comprehensive tutorial for plotting focal mechanism "beach-balls" using the PyGMT package for Python. (Resulting map of this d

3 Dec 13, 2022
A python script to visualise explain plans as a graph using graphviz

README Needs to be improved Prerequisites Need to have graphiz installed on the machine. Refer to https://graphviz.readthedocs.io/en/stable/manual.htm

Edward Mallia 1 Sep 28, 2021
Visualize and compare datasets, target values and associations, with one line of code.

In-depth EDA (target analysis, comparison, feature analysis, correlation) in two lines of code! Sweetviz is an open-source Python library that generat

Francois Bertrand 2.3k Jan 05, 2023
Visualization of numerical optimization algorithms

Visualization of numerical optimization algorithms

Zhengxia Zou 46 Dec 01, 2022
Simple Inkscape Scripting

Simple Inkscape Scripting Description In the Inkscape vector-drawing program, how would you go about drawing 100 diamonds, each with a random color an

Scott Pakin 140 Dec 27, 2022
Statistical data visualization using matplotlib

seaborn: statistical data visualization Seaborn is a Python visualization library based on matplotlib. It provides a high-level interface for drawing

Michael Waskom 10.2k Dec 30, 2022