Jupyter Extension for Plotly.py
See https://plot.ly/python/getting-started/ for details.
Install with jupyter labextension install plotlywidget
in JupyterLab, otherwise
just install Plotly.py and it will automatically work in Classic Notebooks.
The plotly Jupyter extension
Jupyter Extension for Plotly.py
See https://plot.ly/python/getting-started/ for details.
Install with jupyter labextension install plotlywidget
in JupyterLab, otherwise
just install Plotly.py and it will automatically work in Classic Notebooks.
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
TypeError
when using orjson
to serialize pandas.NA
[#5040].category_orders
on px.pie
raised ColumnNotFoundError
[#5000].DeprecationWarning
shown when creating a px
chart [#5080, #5086]plotly[express]
extra for easily installing Plotly Express dependencies [#4644]subtitle
attribute to all Plotly Express traces [#4830].pointcloud
and heatmapgl
traces from the API [#4815]tenacity
dependency [#4831]plotly.graph_objects
module. Notable changes include:titlefont
, titleposition
, titleside
, and titleoffset
[#7212].bardir
attribute (use orientation
instead) [#7214]annotation.ref
attribute (use annotation.xref
and annotation.yref
instead) [#7215]opacity
attribute (use alpha channel of error bar color
attribute instead) [#7214]gl3d.cameraposition
(use gl3d.camera
instead) [#7217]plot3dPixelRatio
from config [#7231]zauto
, zmin
and zmax
from the surface trace [#7234]autotick
attributes from cartesian axes [#7236]transforms
from the API [#7240, #7254]go.FigureWidget
to use anywidget
[#4823]go.FigureWidget.show
to return FigureWidget
instead of displaying Figure
[#4869]px
functions for maps: scatter_map
, line_map
, choropleth_map
, and density_map
.Updated Plotly.js from version 2.34.0 to version 2.35.0. See the plotly.js CHANGELOG for more information. These changes are reflected in the auto-generated plotly.graph_objects
module. Notable changes include:
Fixed a bug in integer validation of arrays that threw an error when an array contained a mix of strings and integers.
plotly.graph_objects
module. Notable changes include:subtitle
attribute to layout.title
to enable adding subtitles to plots [#7012]category_order
on cartesian axes [#6223],
with thanks to @acxz and @prabhathc for the contribution!ticklabelindex
for drawing the label for each minor tick n positions away from a major tick,
with thanks to @my-tien for the contribution! [#7036]ticklabelstandoff
and ticklabelshift
to cartesian axes to adjust positioning of tick labels,
with thanks to @my-tien for the contribution! [#7006]x0shift
, x1shift
, y0shift
, y1shift
to shapes to add control over positioning of shape vertices on (multi-)category axes,
with thanks to @my-tien for the contribution! [#7005]pytest
at version 8.1.1 to match.IntegerValidator
to handle extras
option to allow supporting additional keyword values. For example, 'bold' and 'normal' as well as integers as used in font weights [#4612].plotly.graph_objects
module. Notable changes include:plotly.graph_objects
module. Notable changes include:zorder
attribute to various cartesian traces for controlling stacking order of SVG traces drawn into a subplot [#6918, #6953],
This feature was anonymously sponsored: thank you to our sponsor!sizemode
to cone trace [#6938]layout.hoversubplots
to enable hover effects across multiple cartesian suplots sharing one axis [#6947, #6950]orjson
loading issue [#4562]plotly.graph_objects
module. Notable changes include:
plotly.graph_objects
module. Notable changes include:layout.barcornerradius
and trace.marker.cornerradius
properties to support rounding the corners of bar traces [#6761],
with thanks to Displayr for sponsoring development!autotickangles
to cartesian and radial axes [#6790], with thanks to @my-tien for the contribution!align
option to sankey nodes to control horizontal alignment [#6800],
with thanks to @adamreeve for the contribution!bdata
) and shape
(for 2 dimensional arrays) to declare various typed arrays i.e. dtype=(float64|float32|int32|int16|int8|uint32|uint16|uint8)
[#5230]stadiamaps.com
, the users may also need to provide their own API_KEY via config.mapboxAccessToken
[#6776, #6778]mode
is deterministic from px
[#4429]pd.Categorical
dtype with unobserved categories [#4437]column_names
returns an unmaterialized object: generator, iterator, etc. [#4442]FutureWarning
being displayed when setting the color
argument in plotly.express
[#4519]plotly.graph_objects
module. Notable changes include:insiderange
to cartesian axes to help avoid overlap between visible grid lines and tick labels of the counter axis when they are positioned inside [#6735], this feature was anonymously sponsored: thank you to our sponsor!candlestick
using react [#6757]pandas.Series.dt.to_pydatetime()
calls and suppress the FutureWarning
they currently emit. [#4379]BasePlotlyType.to_json()
method [#4301]plotly.graph_objects
module. Notable changes include:autorangeoptions
(clipmin
, clipmax
, minallowed
, maxallowed
, include
) as well as minallowed
and maxallowed
to cartesian, gl3d and radial axes [#6547]scaleanchor
to allow removing a constraint that is set by default [#6712], with thanks to @lvlte for the contribution!plotly.graph_objects
module. Notable changes include:
px
methods now accept data-frame-like objects that support a dataframe interchange protocol, such as polars, vaex, modin etc. This protocol has priority on to_pandas
call, but will only be used if pandas>=2.0.2 is installed in the environment.px
methods now accept data-frame-like objects that support a toPandas()
method, such as Spark DataFrames, or a to_pandas_df()
method, such as Vaex DataFrames.frame.insert
[#4246]texttemplate
to shape.label for parametric shapes i.e. line, rect and circle [#6527],
with thanks to the Volkswagen Center of Excellence for Battery Systems for sponsoring development!legend
references to traces and legend2
, legend3
, etc. to layout,
also add visible
to legend i.e. to allow positioning multiple legends on a graph [#6535],
this feature was anonymously sponsored: thank you to our sponsor!legend.xref
and legend.yref
to enable container-referenced positioning of legends [#6589], with thanks to Gamma Technologies for sponsoring the related development.colorbar.xref
and colorbar.yref
to enable container-referenced positioning of colorbars [#6593], with thanks to Gamma Technologies for sponsoring the related development.px
methods now accept data-frame-like objects that support a to_pandas()
method, such as polars, cudf, vaex etc [#4244], [#4286]px.*(line_close=True)
[#4190]make_subplots
function to handle situations where the user-input specs cause the domain to exceed 1 by small amounts [#4153]yref
parameter [#4177]use_2to3
setuptools arg, which is invalid in the latest Python and setuptools versions [#4206]colors.n_colors
where generated RGB color values were not being constrained to stay between 0 and 255 [#4110]title.automargin
to enable automatic top and bottom margining for both container and paper referenced titles [#6428],
with thanks to Gamma Technologies for sponsoring the related development.label
attribute to shapes [#6454], with thanks to the Volkswagen Center of Excellence for Battery Systems for sponsoring development!labelalias
to various axes namely cartesian, gl3d, polar, smith, ternary, carpet,
indicator and colorbar [#6481],
this feature was anonymously sponsored: thank you to our sponsor!charset="utf-8"
to scripts in to_html
[#4114]packaging
to install requirements, fixing a No module named 'packaging
error on Python 3.6 [#4113]str
in hover_data
and custom_data
in plotly.express
[4083]plotly.graph_objects
module.write_html()
now explicitly encodes output as UTF-8 because Plotly.js' bundle contains such characters [#4021] and [#4022]iframe
renderer regression from 5.12 and also fixed error when this renderer was used in the very first cell in a notebook [#4036]shift
and autoshift
to cartesian y axes to help avoid overlapping of multiple axes [#6334],
with thanks to Gamma Technologies for sponsoring the related development!scatter
trace i.e. alignmentgroup
, offsetgroup
, scattermode
and scattergap
[#6381],
this feature was anonymously sponsored: thank you to our sponsor!marker.cornerradius
attribute to treemap
trace [#6351]marker.angle
attribute now accepts iterables where appropriate [#4013]selector=0
now correctly returns the first trace in .select_traces()
and related methods [#3817]scattermapbox
[#5827],
with thanks to @elben10 for the contribution!angle
, angleref
and standoff
to marker
and add backoff
to line
; also introduce new arrow symbols to facilitate drawing networks [#6297]minreducedwidth
and minreducedheight
to layout for increasing control over automargin [#6307]entrywidth
and entrywidthmode
to legend [#6202, #6324]sankey
links with arrowsselections
, newselection
and activeselection
layout attributes to have persistent and editable selections over cartesian subplotsunselected.line.color
and unselected.line.opacity
options to parcoords
tracepattern_shape
options now available in px.timeline()
#3774facet_*
and category_orders
now available in px.pie()
#3775px
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 @jvddflaglist
attributes, to support upcoming changes to ax.automargin
in plotly.js plotly.js#6193, #3749(no changes, due to a mixup with the build process!)
10px 2px
are accepted #3722six
, with thanks to @maresb, @hugovk, @tirkarthi, @martinRenou, and @BjoernLudwigPTBgo.Figure
methods, for better IDE auto-completion #3708minor
ticks to cartesian axesgriddash
option to most axespattern_shape
options to px.area()
#3668fillpattern
options to scatter
traceticklabelstep
to reduce labels on cartesian axes and colorbarstext_auto
argument to px.bar
, px.histogram
, px.density_heatmap
, px.imshow
#3518ff.create_annotated_heatmap
, ff.create_county_choropleth
, ff.create_gantt
#3518div_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 @Skn0ttff.create_annotated_heatmap
passes rgba()
colors into to_rgb_color_list
#3478 with thanks to @janoshtexttemplate
for histogram-like and heatmap-like tracessmith
that supports scattersmith
trace types for visualizing data in the complex domainplotly.graph_objects
module. Notable changes include:plotly.graph_objects
module. Notable changes include:legend.groupclick
optionsplotly.graph_objects
module. Notable changes include:geo
subplots from a more recent version of d3-geo
d3-format
scattergl
, splom
and parcoords
by implementing plotGlPixelRatio
for those tracesgapminder
and stocks
dataset to facilitate testing, documentation and demos #3305markers
argument to display markers, and all but line_mapbox
accept symbol
to map a field to the symbol attribute, similar to scatter-like functions #3326px.scatter
and px.density_contours
now support new trendline
types 'rolling'
, 'expanding'
and 'ewm'
#2997px.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'
#2997px.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 #2997px.ecdf()
function for Empirical Cumulative Distribution Functions #3330dtype
of Object were being converted to list
values when added to a Figure (#3292, #3293)plotly.graph_objects
module. Notable changes include:<trace>.legendgrouptitle
attribute for legend group titles%h
text formatting directive for half-yearsItems 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.
plotly.graph_objects
module. Notable changes include:graph_objects
like area
traces and scatter.(t|r)
and layout.(radial|angular)axis
attributesfig.update_layout(modebar_add=["v1hovermode", "toggleSpikeLines"])
)mode="text"
bar
traces, textposition
now defaults to "auto"
heatmapgl
, pointcloud
traces as well as all transform
attributesplotlywidget
into jupyterlab-plotly
and packaged them as a federated extension #3142 with massive thanks to @fcollonval for the contributioninclude_plotlyjs='cdn'
and for "connected" renderers. #2961 with thanks to @adehad for the contributionretrying
dependency with tenacity
#2911 with thanks to @jmsmdy for the contributioncategory_orders
when computing discrete mappings (color, symbol, line-dash, pattern-shapes) as well as facets, even those values which are absent in the data #3247icicle
trace type, with thanks to @Kully and @mtwichan of Zyphr for their contribution!marker.pattern
options for bar
-like trace types with thanks to @s417-lama for the contribution!legendrank
attribute to control rank of traces within legendspx.bar()
, px.histogram()
and px.bar_polar()
now support the pattern_shape
argument #3252px.icicle()
function, with thanks to @Kully and @mtwichan of Zyphr for their contribution! #3256plotly.colors
: get_colorscale()
and sample_colorscale()
#3136 and #3186 with thanks to @CarlAndersson for the contributionsorjson
is present #2955layout.(width|height)
#3240plotly.tools.mpl_to_plotly()
with thanks to @fdion #3143px.timeline()
now allows hover_data
formatting of start and end times 3018plotlywidget
extension for JupyterLab 3 3021plotly.graph_objects
module. Notable changes include:px.histogram()
Y-axis labels now take into account histnorm
and barnorm
2989px.histogram()
marginal
and facet_*
now work correctly together 3014plotly.graph_objects
module. Notable changes include:ticklabelposition
attributepx.imshow
now supports facet_col
and animation_frame
arguments for visualizing 3-d and 4-d images 2746px.defaults
now supports color_discrete_map
, symbol_map
, line_dash_map
, labels
and category_orders
as well as a .reset()
method 2957plotly.graph_objects
module. Notable changes include:ticklabelposition
attribute to enable positioning tick labels inside the plotting areascaleanchor
and matches
on cartesian axes for matched square subplotsautotypenumbers
attribute which is now set to strict
in the default templatesautomargins
for small figurespx.choropleth
, px.scatter_geo
and px.line_geo
now support faceting as well as fitbounds
and basemap_visible
2923px.scatter_geo
and px.line_geo
now support geojson
/featureidkey
input 2923px.scatter_geo
now supports symbol
2923go.Figure
now has a set_subplots
method to set subplots on an already
existing figure. 2866Turbo
colorscale and fancier swatch display functions
2882image_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).
2879selector
argument to updater/selector functions now accepts int
s and str
s
2894px.scatter_geo
support for text
is fixed 2923x
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
). 2761add_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)add_hline
, add_vline
, add_hrect
, add_vrect
functions, which also support the row="all"
and col="all"
arguments. (#2840)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)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)some_fig.update_layout(geo_ltaxis_showgrid=True)
shows Bad property path:\ngeo_ltaxis_showgrid\n ^
and lists the valid properties for geo
.plotly.graph_objects
module.plotly.graph_objects
module.plotly.io.full_figure_for_development()
and plotly.graph_objects.Figure.full_figure_for_development()
(#2737)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 (#2691px.imshow
has a new contrast_rescaling
argument in order to choose how
to set data values corresponding to the bounds of the color range
(#2691hover_data
(#2749)FigureWidget
(#2711) with thanks to @meffmaddfull_html()
with html=False
(#2469) with thanks to @tallamjrff.distplot()
now only computes traces that will be shown (#2730) with thanks to @akbo.hist()
works with latest version of Pandas (#2713) with thanks to @Kerybasengine
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)scattergl
when render_mode="webgl"
in Plotly Express (#2614)"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)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)package-lock.json
with many fewer security warnings (#2636)add_traces()
now accepts bare int
-like values for rows
/cols
as well as lists thereof (#2546), with thanks to @MCBoarder289 for the contribution!row
/col
now accept int
-like values, not strictly int
values (#2451), with thanks to @MCBoarder289 for the contribution!px.sunburst
and px.treemap
with path
input (#2524)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).trendline
argument more robust and made it work with datetime x
values (#2554)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)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)plotly.colors
and plotly.express.colors
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)plotly.express.data
: stocks
, experiment
, medals_wide
and medals_long
. (#2336)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.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):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.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
.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
.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.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.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.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)px.Constant
or px.Range
objects in the place of column references so as to express constant or increasing integer values. (#2336)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).TypeError: unhashable type: 'Template'
during Figure
construction when plotly.io.templates.default
is set to a Template
object rather than a string.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 information #2377.master
branch of Plotly.js, which makes for faster QA and development cycles #2349. Thanks @zouhairm for this Pull Request!This version includes several performance improvements (#2368, #2403).
figure.layout.xaxis
) are no longer created eagerly during graph object construction. Instead, they are created lazily the first time the property is accessed.layout.xaxis.rangebreaks
layout.hovermode="x unified"
), in which the hover box shows the information for all traces at a given x (or y) positionnode.customdata
and link.customdata
to sankey tracespx.imshow
now accepts xarray
inputs, with metadata being used for axis labels, hover and colorbar #2166opacity
in px.pie
, px.funnel_area
, px.density_mapbox
, px.funnel
#2317, with thanks to @tvaucher for the contribution!nose
testing framework #2217@types/plotly.js
#2223update_annotations
, update_shapes
and update_layout_images
now no longer require the patch
argument, as per the docstring #2167px.defaults
no longer accepts arbitrary keys #2168pandas
is not installed #2125path
argument of px.sunburst
/px.treemap
and add values of color
column in hoverlabel for px.sunburst
/px.treemap
#2133legend.title
attribute and so now has shorter trace name
s #2051px.parallel_categories
to determine which columns of the data frame to draw has been changed and made more configurable with the dimensions_max_cardinality
argument #2102simple_white
colorbar styling has been streamlined #2110jupyterlab-plotly
and plotlywidget
JupyterLab extensions should now share code when installed together, resulting in smaller JupyterLab vendor bundle sizes #2103category_orders
are now respected independent of the contents of the data set #2084go.Scattergl
symbols now accept numeric specification #1928px.scatter
trendline coefficients are now more readable #1984px.sunburst
and px.treemap
now accept a path
argument for passing
columns of a rectangular dataframe to build the charts #2006px.choropleth
now accepts a user-supplied geojson
attribute #2057px.choropleth
and px.choropleth_mapbox
now accept featureidkey
to specify the GeoJSON field to use to match locations
#2057px.choropleth
and px.choropleth_mapbox
now accept discrete color #2057px.bar_polar
now accepts continuous color #2017layout.uniformtext
attribute allows for automatic standardization of font sizes across bar-like and hierarchical traces. See the
plotly.js CHANGELOG
for more informationpillow
module not installed #1993plotly.express
generated plots no longer have a default height of 600 pixels, instead they inherit the default height of regular figures #1990. To restore the old behavior, set px.defaults.height=600
once per session, or set the height
keyword argument to any px.function()
to 600.zmin/zmax
parameter in px.imshow
for single-channel images #1981px.pie
,
px.sunburst
, px.treemap
, px.funnel
, and px.funnel_area
(#1909) px.density_mapbox
and
px.choropleth_mapbox
#1937.center
and mapbox_style
#1937.scatter_polar
, line_polar
, bar_polar
) now
have a range_theta
keyword argument for representing only an angular
section #1969._r
suffix that reverses their direction #1933_r
to its name #1933add_annotations
/add_shapes
/add_images
methods to no longer default to adding objects in paper coordinates. This allows plotly.js to determine the default reference frame based on context (#1888)plotly.express.imshow
convenience function to display images and heatmaps (#1855, #1885)simple_white
template (#1864). Special thanks to @joelostblom for this contribution.facet_col_wrap
argument (#1838)treemap
trace type (plotly.js#4185, plotly.js#4219, plotly.js#4227, plotly.js#4242)add_*
/select_*
/for_each_*
/update_*
convenience figure methods for annotations, shapes, and images (#1817)overwrite
kwarg to update*
figure methods to fully replace property values, rather than update them recursively (#1726)texttemplate
attribute to all traces that support on-graph text (plotly.js#4071, plotly.js#4179)hovertemplate
and texttemplate
e.g. '%{x|%b %-d, %Y}'
(plotly.js#4071)bar
trace length, width, on-graph text positioning, marker style and error bars (plotly.js#4180, plotly.js#4186)create_gantt
figure factory now resizes responsively (#1724)graph_objects.indicator.Gauge
has been renamed from stepss
to steps
create_gantt
figure factory may now be hidden by clicking on the legend (#1665). Special thanks to @csabaszan for this contribution!indicator
traces (plotly/plotly.js#3978)choroplethmapbox
traces (plotly/plotly.js#3988)densitymapbox
traces (plotly/plotly.js#3993)style
values: open-street-map
, carto-positron
, carto-darkmatter
,
stamen-terrain
, stamen-toner
, stamen-watercolor
and white-bg
that do not require a Mapbox access token (plotly/plotly.js#3987, plotly/plotly.js#4068)sourcetype
value raster
and image
and type
raster
for mapbox layout layers (plotly/plotly.js#4006)below
attribute to scattermapbox
traces (plotly/plotly.js#4058)below: 'traces'
in mapbox layout layers (plotly/plotly.js#4058)sourceattribution
attribute to mapbox layout layers (plotly/plotly.js#4069)labelangle
and labelside
attributes to parcoords
traces (plotly/plotly.js#3966)doubleClickDelay
config option (plotly/plotly.js#3991)showEditInChartStudio
config option (plotly/plotly.js#4061)line_3d
plotly express function was not visible by default when importing *
from plotly.express
(#1667)This is a major release that includes many new features, and a few breaking changes. See the version 4 announcement for a summary of the important changes.
plotly.express
module (#1613)plotly.io.write_html
and plotly.io.to_html
functions for exporting figures to HTML (1474). Also available as .write_html
and .to_html
figure methods.update_layout
, update_traces
, update_xaxes
, etc.) (#1624). See the new Creating and Updating Figures documentation page for more details.make_subplots
(#1528)make_subplots
(#1564)data
property to the Figure
constructor (#1614).pop
method to graph object classes (#1614)jupyterlab-plotly
JupyterLab extension for rendering figures in JupyterLab. Replaces the @jupyterlab/plotly-extension
extension, and includes JupyterLab 1.0 support.plotly.colors
module, and support for specifying this wide range of colorscales by name. Also added support for specifying colorscales as a list of colors, in which case the color spacing is assumed to be uniform (#1647).sphinx-gallery
renderer for embedding plotly figures in Sphinx-Gallery (#1577, plotly/plotly-sphinx-gallery).chart-studio
distribution package. The following modules have been moved to a new top-level chart_studio
module:plotly.plotly
-> chart_studio.plotly
plotly.api
-> chart_studio.api
plotly.dashboard_objs
-> chart_studio.dashboard_objs
plotly.grid_objs
-> chart_studio.grid_objs
plotly.presentation_objs
-> chart_studio.presentation_objs
plotly.widgets.GraphWidget
class for displaying online figures hosted by Chart Studio as ipywidgets has been removed. Please use the offline, and much more capable, plotly.graph_objects.FigureWidget
class instead.fileopt
argument to chart_studio.plotly.plot
has been removed, so in-place modifications to previously published figures are no longer supported, and a figure will always overwrite a figure with the same name.'plotly'
template is used as the default theme across all figures.plotly
distribution package, the bundled geographic shape files used by the create_choropleth
figure factory have been moved to a new optional plotly-geo
distribution package (1604)create_choropleth
and create_gantt
figure factories now always returns Figure
objects, rather than dictionaries (#1600, #1607)..add_trace
, .add_traces
, .add_scatter
, etc.) now return a reference to the calling figure, rather than the newly created trace (#1624)plotly.tools.make_subplots
has been moved to plotly.subplots.make_subplots
, though it is still available at the previous location for backward compatibilityplotly.graph_objs
module has been moved to plotly.graph_objects
, though it is still available at the previous location for backward compatibility (#1614)uid
properties are only generated automatically when a trace is added to a FigureWidget
. When a trace is added to a standard Figure
graph object the input uid
, if provided, is accepted as is (#1580).datetime
objects that include timezones are not longer converted to UTC (#1581)layout.annotations
) is updated with a list/tuple that is longer than the current value, the extra elements are appended to the end of the tuple.bar
trace error bars in built-in templates (1656)bingroup
to histogram
, histogram2d
and histogram2dcontour
to group traces to have compatible auto-bin values
(#3845)itemclick
and itemdoubleclick
attributes to set or disable
the legend item click and double-click behavior
(#3862)PlotlyJSONEncoder
encoding error when simplejson
is installed
(#1556,
#1561)validate=False
option for all renderer types
(#1576)select_traces
, for_each_trace
, and update_traces
figure
methods for accessing and updating traces by subplot location and trace
properties
(#1534)select_*
, for_each_*
, and update_*
figure methods for
accessing and updating subplot objects (xaxis
, scene
, polar
, etc)
(#1548)plotly_unselect
plotly.js event in a new
on_unselect
trace method
(#1542). Thanks to
@denphi for this contribution!plasma
for the plotly
, plotly_white
, and
plotly_dark
templates for plotly.py version 4
(#1274,
#1549)plotly
, plotly_white
, and
plotly_dark
templates for plotly.py version 4
(#1549)heatmap
colorscales can be overridden
without specifying autocolorscale=False
(#1454,
#1549)UnboundLocalError
error in the presence of a missing or corrupt
~/.plotly/.config
file
(#1551)sankey
traces with cartesian subplots
(#1527,
plotly/plotly.js#3802)layout.legend.itemsizing = 'constant'
in built-in templates
that was made in 3.8.0. This resulted in unexpectedly large legend entries in
some common cases (#1526)sunburst
(plotly/plotly.js#3594),
waterfall
(plotly/plotly.js#3531),
and volume
(plotly/plotly.js#3488).plotly.io.to_html
and plotly.io.write_html
functions to export
figures as html (#1474).animation_opts
argument to plotly.offline.plot
and
plotly.offline.iplot
to control the auto-play animation settings
(#1503). Special thanks
to @TakodaS for this contribution!.plotly
settings
directory (#1498). Special
thanks to @pb-cdunn for this contribution!OSError
when processing time series data using Python 3.7+
(#1402,
#1501)auto_play
argument to offline plot
and iplot
to control
whether figures with frames are automatically animated when the figure is
loaded
(#1447)plotly.plotly.create_animations
(#1432)ternary_contour
figure factory that was
added in 3.6.0. The new implementation uses the native plotly.js ternary axes
and provides ILR transform support.
(#1418)selectedpoints
property of FigureWidget
traces is
updated on the Python side in response to plotly.js selection events
(#1433)scipy
an optional import for the ternary contour figure factory
(#1423)numpy.asscalar
function
(#1428)line.color
colorbars for scatter3d traces
(#1085,
plotly/plotly.js#3384)hovertemplate
on scatterpolar
, scatterpolargl
,
scatterternary
, barpolar
, choropleth
, scattergeo
, and
scattermapbox
trace
(plotly/plotly.js#3398,
plotly/plotly.js#3436)<sup>
, <sup>
, <b>
, <i>
and <em>
pseudo-html
tags in extra (aka trace "name") hover labels
(plotly/plotly.js#3443)DataArray
s) to
numpy arrays
(#1393). Special thanks to
@malmaud for this contribution!update
method with legacy title*
properties
(#1403)title
properties (e.g. layout.title
) from
strings into compound objects that contain the text as the text
property
along with new title placement attributes x
, y
, xref
, yref
, xanchor
,
yanchor
and pad
. Plotly.py 3.5.0 follows the new schema, but still
supports specifying title
as a string, in which case the string is assigned
to the title.text
property
(#1302)title*
properties
(e.g. layout.titlefont
) under the title
object (e.g. layout.title.font
).
Plotly.py 3.5.0 follows the new schema, but still
supports the legacy title*
properties by mapping them to the corresponding
title.*
property
(#1302)update
method on graph_objs
now returns the updated object in order
to support chaining multiple update operations together
(#1379)show_link
option has been set to False
by default in the offline
plot
and iplot
functions. Now that the "send data to cloud" button has
been disabled by default in plotly.js 1.43.0, no buttons/links will be
displayed by default that result in data being sent off of the local machine
(#1304)config
options that are not known by plotly.py result in a warning but are
still passed along to plotly.js. Prior to this change these unknown options
were dropped silently
(#1290)layout.colorscale
properties. Previously the colorscales were defined for
each trace type individually. This reduces the size of the resulting theme
files
(#1303)FigureWidget
performance regression that, when working with
large datasets, resulted in a slight freeze of the widget after user
interactions (pan, zoom, etc)
(1305)ELECTRON_RUN_AS_NODE
environment variable is set
(#1293)'responsive'
config key was being silently blocked
(#1290)validate
and strip_style
Figure
methods in matplotlylib conversion logic
(#1128)config
options are now supported when using plotly.offline.iplot
to
display a figure in JupyterLab. Requires version 0.18.1 of the
@jupyterlab/plotly-extension
extension.
(#1281,
jupyterlab/jupyter-renderers#168)plotly_domain
values are now supported in FigureWidget in both
the classic notebook and JupyterLab
(#1284)Series
or numpy array
(regression introduced in 3.4.0)
(#1257,
plotly/plotly.js#3211)args
property of
layout.updatemenu.Button()
when value is a list
that starts with a list
(#1265)plotly.io.write_image
to hang on Windows after
exporting more than ~25 images
(#1255)scattergl
trace with mode='lines'
and
more than 100k points
(#1271)iplot
in the classic notebook
(#1263)parcats
) trace type for the visualization
of multi-dimensional categorical datasets
(plotly/plotly.js#2963)plotly.offline.iplot
and plotly.graph_objs.FigureWidget
.
Note: There are still outstanding issues with MathJax rendering in FireFox,
but it is now working well in Chrome.
(#1243)include_mathjax
argument to plotly.offline.plot
to support
the creation of HTML files with LaTeX typesetting
(#1243)plotly.offline.get_plotlyjs
function that returns the
contents of the bundled plotly.js library as a string
(#637,
#1246)plotly.offline.get_plotlyjs_version
function that returns
the version of the bundled plotly.js library
(#1246)plotly.offline.plot
now contain logic
to automatically resize the figure responsively. This logic was previously
only added for html files.
(#1043,
#1234)plotly.offline.iplot
in the classic Jupyter
Notebook will now resize responsively
(#1234)'cdn'
, 'directory'
, and path string include_plotlyjs
options
in plotly.offline.plot
(#1234)'cdn'
, the resulting html file/div includes a script tag reference
to the plotlyjs cdn.'directory'
, the resulting html file/div includes a script tag
reference to a plotly.min.js bundle in the same directory as the html file.
If output_type
is 'file'
then this plotly.min.js bundle is created in
the output directory if it doesn't already exist.'.js'
, the resulting html file/div includes
a script tag that references this exact path. This can be used to point
to a plotly.js bundle from an alternative CDN.color_threshold
argument to the create_dendrogram
figure
factory to control the dendrogram clustering cutoff
(#995,
#1075,
#1214)autorange='reversed'
in 3D axes
(#803,
plotly/plotly.js#3141)modebar
layout style attributes:
orientation
, bgcolor
, color
and activecolor
(plotly/plotly.js#3068,
plotly/plotly.js#3091)title
, titleposition
and titlefont
attributes to pie traces
(plotly/plotly.js#2987)hoverlabel.split
attribute to ohlc
and candlestick
traces to
split hover labels into multiple pieces
(plotly/plotly.js#2959)line.shape
values 'hv'
, 'vh'
, 'hvh'
and 'vhv'
in scattergl
traces
(plotly/plotly.js#3087)hoverinfo
for sankey
traces
(#3096,
#3150)textfont
settings in pie traces
(#3130)reversescale=True
in the
create_annotated_heatmap
figure factory
(#1251)plotly.offline.iplot
would fail to render in the classic
Jupyter Notebook if the notebook contained a Markdown headline with the text
"Plotly"
(#816)None
values in a scatter.hovertext
list are now omitted from the
hover label rather than being displayed as the string "None"
(#1244)plotly.tools.make_subplots
are now positioned
properly when custom row_width
/column_width
arguments are specified
(#1229)bar.width
property may now be specified as a numpy array or a pandas
series
(#1231,
plotly/plotly.js#3169)scatter3d
traces
(#1139)uuid.uuid4
rather than uuid.uuid1
to work around an upstream
Python bug
(#1235,
#1236)layout.grid.subplots
property may now be specified as a 2D list of
subplot identifiers
(#1220,
#1240)scatter3d
text alignment
(#1055,
plotly/plotly.js#3180)For use with JupyterLab, the following versions of the following packages must be installed:
Python Packages
JupyterLab Extensions
~/.plotly
configuration
directory until a configuration write operation is performed
(#1195). This change
avoids some concurrency problems associated with running many instances of
plotly.py simultaneously
(#1068).clickmode
and flag 'select'
(#2944)stackgroup
and stackgaps
in scatter traces
(#2960)barpolar
trace type - which replace and augment area traces
(#2954)polar.hole
layout parameter to punch hole at the middle of polar
subplot offsetting the start of the radial range
(#2977, #2996)to_json
, from_json
, read_json
, and write_json
functions in the
plotly.io
package
(#1188)deepcopy
and pickle
operations
(#1191)"~/.plotly"
settings directory may now be customized
using the PLOTLY_DIR
environment variable
(#1195)scaleratio
argument to the create_quiver
figure factory.
When specified, the axes are restricted to this ratio and the quiver arrows
are computed to have consistent lengths across angles.
(#1197)pkg_resources.resource_string
with pkgutil.get_data
to
improve compatibility with cx_Freeze
(#1201)For use with JupyterLab, the following versions of the following packages must be installed:
Python Packages
JupyterLab Extensions
This is a patch release that fixes a few bugs and reintroduces a few version 2 features that were not supported in version 3.
The bundled version of plotly.js remains at 1.40.1
For use with JupyterLab, the following versions of the following packages must be installed:
Python Packages
JupyterLab Extensions
skip_invalid
argument has been added to the Figure
and
FigureWidget
constructors. By default, skip_invalid
is False
and invalid
figure properties will result in an exception (this is identical to the
previous behavior). When skip_invalid
is set to True
, invalid properties
will instead be silently ignored. This argument replaces the _raise
argument that was available in version 2, and makes it possible to import
figure definitions from different plotly versions, where incompatible
properties are ignored rather than causing an exception.to_ordered_dict
method has been added to the Figure
and FigureWidget
classes. This method returns a representation of the figure as a nested
structure of OrderedDict
and list
instances where the keys in each
OrderedDict
are sorted alphabetically. This method replaces the
get_ordered
method that was available in version 2, and makes it possible
to traverse the nested structure of a figure in a deterministic order.Series
and Index
objects storing datetime
values were
incorrectly cast to numeric arrays
(plotly/plotly.py#1160,
plotly/plotly.py#1163)uint64
datatype caused a FigureWidget
error,
and no figure was displayed
(plotly/plotly.py#1155,
plotly/plotly.py#1163)This release introduces the long-anticipated ability to programmatically export figures as high quality static images in both raster and vector formats.
For use with JupyterLab, the following versions of the following packages must be installed:
Python Packages
JupyterLab Extensions
contour
, contourcarpet
and histogram2dcontour
to have corresponding legend items using showlegend
(plotly/plotly.js#2891,
plotly/plotly.js#2914)r0
, dr
, theta0
and dtheta
(plotly/plotly.js#2895)piecolorway
and extendpiecolors
for more control over pie colors
(plotly/plotly.js#2870)splom
attribute dimensions[i].axis.type
to easily override axis type in splom-generated axes
(plotly/plotly.js#2899)scatterpolargl
traces
(plotly/plotly.js#2895)to_image
and write_image
functions in the new plotly.io
package (#1120).
FigureWidget
instances in static contexts
(e.g. nbviewer) just like the built-in ipywidgets
(#1117)README
now includes conda installation instructions alongside the pip instructions.Series
objects (#1149)dash
properties (e.g. scatter.line.dash
) incorrectly rejected dash length lists (#1136)plotly.graph_objs.Annotations
class (#1138)plotly.offline.plot
(#1152)This release is a minor bug-fix update to version 3.1.0
For use with JupyterLab, the following versions of the following packages must be installed:
Python Packages
JupyterLab Extensions
plotly.tools.make_subplots
to create figures with a large number of subplots
plotly/plotly.js#1091.update
method to initialize
an array property (e.g. layout.shapes
)
plotly/plotly.js#1091FigureWidget
problem causing scroll zoom on 3D plots to stutter
plotly/plotly.js#1094tickmode
property in matplotlylib
plotly/plotly.js#1101For use with JupyterLab, the following versions of the following packages must be installed. See README.md for instructions.
Python Packages
JupyterLab Extensions
This is a minor bug-fix release to 3.0.0
v
property was ignored in cone
traces
GH1060Note: This release's installation was broken. It has been removed from PyPI
This is a major version with many exciting updates. See the Introducing plotly.py 3.0.0 post for more information.
graph_objs.FigureWidget
classFigureWidget
figures can be updated interactively using property assignment syntaxhelp(go.Figure().batch_animate)
for the full doc string.ValueError
with a description of the error, the invalid property, and the available properties on the level that it was placed in the graph object. Eg. go.Scatter(foo=123)
raises a validation error. See https://plot.ly/python/reference/ for a reference to all valid properties and values in the Python API.plotly.figure_factory.create_choropleth
is now helpful to Anaconda users who do not have the correct modules installed for the County Choropleth figure factory.Please see the migration guide for a full list of the changes and deprecations in version 3.0.0
plotly.min.js
to version 1.38.0.3D cone
trace to visualize vector fields.plotly.min.js
to version 1.37.1.splom
(scatter plot matrix) trace type.plotly.figure_factory.create_choropleth
is more helpful for Windows users on installing geopandas
and dependencies including shapely
.plotly.figure_factory.create_choropleth
now works in Windows without raising an OSError. The module now uses cross-platform path tools from os
to manipulate and manage the shapefiles contained in this package.import plotly.figure_factory
does not fail if pandas
is not installed. See https://github.com/plotly/plotly.py/pull/958fill_percent
to the .insert
method for the dashboards API. You can now insert a box into the dashboard layout and specify what proportion of the original container box it will occupy. Run help(plotly.dashboard_objs.Dashboard.insert)
for more information on fill_percent
.plotly.min.js
to version 1.35.2.automargin
attribute to cartesian axes and a layout grids
attribute for easy subplot generation.plotly.figure_factory.create_choropleth
has changed some of the default plotting options:hover_info='none'
is now default for the county lines data.plotly.figure_factory.create_choropleth
are now shipped in the package data.help(plotly.figure_factory.create_choropleth)
for examples and how to get started making choropleths of US counties with the Python API.Note: Calling plotly.figure_factory.create_choropleth
will fail with an IOError due to missing shapefiles see: https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md#241---2018-02-21
GraphWidget
for IPython > v6plotly.min.js
to version 1.33.1.violin
trace type.scattergl
using regl
and a completely rewritten polar chart renderer.-column_width
and row_width
parameters for plotly.tools.make_subplots
. Call help(plotly.tools.make_subplots)
for documentation.
plotly.min.js
to version 1.31.2.table
trace for offline plotting.help(plotly.figure_factory.create_bullet)
for examples and how to get started making bullet charts with the API.help(plotly.presentation_objs.Presentations)
for help or check out the new documentationplotly.min.js
to version 1.31.0.table
trace type.plotly.min.js
to version 1.31.0 for plotly.offline
.plotly.min.js
to version 1.30.0 for plotly.offline
.plotly.min.js
to version 1.29.1 for plotly.offline
.figure_factory.create_gantt
and figure_factory.create_dendrogram
now return a Plotly figure (consistent with other figure factory chart types).offline.init_notebook_mode()
is now optional when using offline.iplot()
.plotly.min.js
to version 1.28.3 for plotly.offline
.figure_factory.create_facet_grid
now supports histogram, bar, and box traces.plotly.min.js
to version 1.28.1 for plotly.offline
..create_facet_grid
. Check it out with:import plotly.figure_factory as ff
help(ff.create_facet_grid)
import plotly
with old versions of the decorator
package. We now require installations to use at least version 4.0.6
of the decorator
package. See https://github.com/micheles/decorator/blob/master/CHANGES.md for the decorator
package changelog.FF.create_violin
to control whether violin plots are sorted alphabetically.plotly.api.v2.dash_apps
output_type == "div"
is set in plotly.offline.iplot()
.output_type == "div"
is set in plotly.offline.iplot()
.plotly.min.js
to version 1.26.0 for plotly.offline
.plotly.offline.plot
and plotly.offline.iplot
now accept various configuration options for their arguments.plotly.min.js
to version 1.25.0 for plotly.offline
.iplot
outputs.import plotly
was broken in 2.0.3
and 2.0.2
because the new dashboard_objs
wasn't included in our setup.py
's "packages
". Now it is and import plotly
and the other features introduced in 2.0.3
and 2.0.2
should work.Note: This release's installation was broken. It has been removed from PyPI
dashboard_objs
to top level import.Note: This release's installation was broken. It has been removed from PyPI
import plotly.dashboard_objs
to create a Dashboard
object. You can learn more about Dashboard
objects by running help(plotly.dashboard_objs)
and help(plotly.plotly.plotly.dashboard_ops)
for uploading and retrieving dashboards from the cloud.plotly.offline.plot
now resize as expected when the window is resized.plotly.figure_factory.create_distplot
now can support more than 10 traces without raising an error. Updated so that if the list of colors
(default colors too) is less than your number of traces, the color for your traces will loop around to start when it hits the end.application/vnd.plotly.v1+json
memoize
decorator added to plotly.utils
Grid
from plotly.grid_objs
now accepts a pandas.Dataframe
as its argument.graph_reference
functions are memoized.plotly.exceptions.PlotlyRequestException
is always raised for network
failures. Previously either a PlotlyError
, PlotlyRequestException
, or a
requests.exceptions.ReqestException
could be raised. In particular, scripts
which depend on try-except
blocks containing network requests should be
revisited.plotly.py:sign_in
now validates to the plotly server specified in your
config. If it cannot make a successful request, it raises a PlotlyError
.plotly.figure_factory
will raise an ImportError
if numpy
is not
installed.plotly.figure_factory.create_violin()
now has a rugplot
parameter which
determines whether or not a rugplot is draw beside each violin plot.plotly.tools.FigureFactory
. Use plotly.figure_factory.*
.plotly.tools._*_imported
It was private anyhow, but now
it's gone. (e.g., _numpy_imported
)plotly.py._api_v2
It was private anyhow, but now it's
gone.plotly.plotly.create_animations
and plotly.plotly.icreate_animations
now return appropriate error messages if the response is not successful.frames
are now integrated into GRAPH_REFERENCE and figure validation.https://api.plot.ly/plot-schema
is no longer updated on import.plotly.min.js
to version 1.20.5 for plotly.offline
.FF.create_scatterplotmatrix
now by default does not show the trace labels for the box plots, only if diag=box
is selected for the diagonal subplot type.link text
in the bottom right corner of the offline plots now properly displays Export to [Domain Name]
for the given domain name set in the users' .config
file.FF.create_violin
and FF.create_scatterplotmatrix
now by default do not print subplot grid information in outputhelp(py.image)
for more details.colors.py
file which contains functions for manipulating and validating colors and arrays of colorsFF.create_trisurf
which now can set the interpolation on the colorscalesplotly.offline.plot()
and plotly.offline.iplot()
with a fig
with frames
, the resulting plot will cycle through the figures defined in frames
either in the browser or in an ipython notebook respectively. Here's an example:
`
import IPython.display
from IPython.display import display, HTML
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)figure_or_data = {'data': [{'x': [1, 2], 'y': [0, 1]}], 'layout': {'xaxis': {'range': [0, 3], 'autorange': False}, 'yaxis': {'range': [0, 20], 'autorange': False}, 'title': 'First Title'}, 'frames': [{'data': [{'x': [1, 2], 'y': [5, 7]}]}, {'data': [{'x': [-1, 3], 'y': [3, 9]}]}, {'data': [{'x': [2, 2.6], 'y': [7, 5]}]}, {'data': [{'x': [1.5, 3], 'y': [7.5, 4]}]}, {'data': [{'x': [1, 2], 'y': [0, 1]}], 'layout': {'title': 'End Title'}}]} iplot(figure_or_data)
More examples can be found at https://plot.ly/python/animations/.
- animations now work in online mode: use `plotly.plotly.create_animations` and `plotly.plotly.icreate_animations` which animate a figure with the `frames` argument. Here is a simple example:
import plotly.plotly as py from plotly.grid_objs import Grid, Column
column_1 = Column([0.5], 'x') column_2 = Column([0.5], 'y') column_3 = Column([1.5], 'x2') column_4 = Column([1.5], 'y2')
grid = Grid([column_1, column_2, column_3, column_4]) py.grid_ops.upload(grid, 'ping_pong_grid', auto_open=False)
figure = { 'data': [ { 'xsrc': grid.get_column_reference('x'), 'ysrc': grid.get_column_reference('y'), 'mode': 'markers', } ], 'layout': {'title': 'Ping Pong Animation', 'xaxis': {'range': [0, 2], 'autorange': False}, 'yaxis': {'range': [0, 2], 'autorange': False}, 'updatemenus': [{ 'buttons': [ {'args': [None], 'label': u'Play', 'method': u'animate'} ], 'pad': {'r': 10, 't': 87}, 'showactive': False, 'type': 'buttons' }]}, 'frames': [ { 'data': [ { 'xsrc': grid.get_column_reference('x2'), 'ysrc': grid.get_column_reference('y2'), 'mode': 'markers', } ] }, { 'data': [ { 'xsrc': grid.get_column_reference('x'), 'ysrc': grid.get_column_reference('y'), 'mode': 'markers', } ] } ] }
py.create_animations(figure, 'ping_pong')
### Fixed
- Trisurf now uses correct `Plotly Colorscales` when called
- Fixed a bug in the format of unique-identifiers in columns of grids that are uploaded to plotly via `plotly.plotly.upload`. See https://github.com/plotly/plotly.py/pull/599 for details. In particular, creating plots that are based off of plotly grids is no longer broken. Here is an example:
import plotly.plotly as py from plotly.grid_objs import Grid, Column
c1 = Column([6, 6, 6, 5], 'column 1') c2 = Column(['a', 'b', 'c', 'd'], 'column 2') g = Grid([c1, c2])
py.grid_ops.upload(g, 'my-grid', auto_open=False)
trace = Scatter(xsrc=g[0], ysrc=g[1]) url = py.plot([trace], filename='my-plot')
Then, whenever you update the data in `'my-grid'`, the associated plot will update too. See https://plot.ly/python/data-api for more details on usage and examples.
## [1.12.9] - 2016-08-22
### Fixed
- the colorbar in `.create_trisurf` now displays properly in `offline mode`.
### Updated
- the colorbar in `.create_trisurf` now displays the appropriate max and min values on the ends of the bar which corresponding to the coloring metric of the figure
- `edges_color` is now a param in `.create_trisurf` which only takes `rgb` values at the moment
## [1.12.8] - 2016-08-18
### Fixed
- Fixed color bug with trisurf plots where certain triangles were colored strangely. The coordinates of `rgb(...)` are now rounded to their nearest integer (using Python3 method of rounding), then placed in the color string to fix the issue.
## [1.12.7] - 2016-08-17
### Fixed
- Edited `plotly.min.js` due to issue using `iplot` to plot offline in Jupyter Notebooks
- Please note that `plotly.min.js` may be cached in your Jupyter Notebook. Therefore, if you continue to experience this issue after upgrading the Plotly package please open a new notebook or clear the cache to ensure the correct `plotly.min.js` is referenced.
## [1.12.6] - 2016-08-09
### Updated
- Updated `plotly.min.js` from 1.14.1 to 1.16.2
- Trace type scattermapbox is now part of the main bundle
- Add updatemenus (aka dropdowns) layout components
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates
## [1.12.5] - 2016-08-03
### Updated
- `.create_trisurf` now supports a visible colorbar for the trisurf plots. Check out the docs for help:
import plotly.tools as tls help(tls.FigureFactory.create_trisurf)
## [1.12.4] - 2016-07-14
### Added
- The FigureFactory can now create 2D-density charts with `.create_2D_density`. Check it out with:
import plotly.tools as tls help(tls.FigureFactory.create_2D_density)
## [1.12.3] - 2016-06-30
### Updated
- Updated `plotly.min.js` from 1.13.0 to 1.14.1
- Numerous additions and changes where made to the mapbox layout layers attributes
- Attribute line.color in scatter3d traces now support color scales
- Layout shapes can now be moved and resized (except for 'path' shapes) in editable contexts
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1141----2016-06-28) for additional information regarding the updates
- Updated `default-schema`
### Added
- Added `update_plotlyjs_for_offline` in makefile in order to automate updating `plotly.min.js` for offline mode
## [1.12.2] - 2016-06-20
### Updated
- Updated plotly.min.js so the offline mode is using plotly.js v1.13.0
- Fix `Plotly.toImage` and `Plotly.downloadImage` bug specific to Chrome 51 on OSX
- Beta version of the scattermapbox trace type - which allows users to create mapbox-gl maps using the plotly.js API. Note that scattermapbox is only available through custom bundling in this release.
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1130----2016-05-26) for additional additions and updates.
### Added
- The FigureFactory can now create gantt charts with `.create_gantt`. Check it out with:
import plotly.tools as tls help(tls.FigureFactory.create_gantt)
- Ability to download images in offline mode. By providing an extra keyword `image` to the existing plot calls, you can now download the images of the plots you make in offline mode.
### Fixed
- Fixed check for the height parameter passed to `_plot_html`, and now sets the correct `link text` for plots
generated in offline mode.
## [1.12.1] - 2016-06-19
### Added
- The FigureFactory can now create violin plots with `.create_violin`. Check it out with:
import plotly.tools as tls help(tls.FigureFactory.create_violin)
## [1.12.0] - 2016-06-06
### Added
- Added ability to enable/disable SSL certificate verification for streaming. Disabling SSL certification verification requires Python v2.7.9 / v3.4.3 (or above). This feature can be toggled via the `plotly_ssl_verification` configuration setting.
## [1.11.0] - 2016-05-27
### Updated
- Changed the default option for `create_distplot` in the figure factory from `probability` to `probability density` and also added the `histnorm` parameter to allow the user to choose between the two options.
Note: This is a backwards incompatible change.
- Updated plotly.min.js so the offline mode is using plotly.js v1.12.0
- Light position is now configurable in surface traces
- surface and mesh3d lighting attributes are now accompanied with comprehensive descriptions
- Allowed `create_scatterplotmatrix` and `create_trisurf` to use divergent and categorical colormaps. The parameter `palette` has been replaced by `colormap` and `use_palette` has been removed. In `create_scatterplotmatrix`, users can now:
- Input a list of different color types (hex, tuple, rgb) to `colormap` to map colors divergently
- Use the same list to categorically group the items in the index column
- Pass a singlton color type to `colormap` to color all the data with one color
- Input a dictionary to `colormap` to map index values to a specific color
- 'cat' and 'seq' are valid options for `colormap_type`, which specify the type of colormap being used
- In `create_trisurf`, the parameter `dist_func` has been replaced by `color_func`. Users can now:
- Input a list of different color types (hex, tuple, rgb) to `colormap` to map colors divergently
- Input a list|array of hex and rgb colors to `color_func` to assign each simplex to a color
### Added
- Added the option to load plotly.js from a CDN by setting the parameter `connected=True`
in the `init_notebook_mode()` function call
- The FigureFactory can now create trisurf plots with `.create_trisurf`. Check it out with:
import plotly.tools as tls help(tls.FigureFactory.create_trisurf)
## [1.10.0] - 2016-05-19
### Fixed
- Version 1.9.13 fixed an issue in offline mode where if you ran `init_notebook_mode`
more than once the function would skip importing (because it saw that it had
already imported the library) but then accidentally clear plotly.js from the DOM.
This meant that if you ran `init_notebook_mode` more than once, your graphs would
not appear when you refreshed the page.
Version 1.9.13 solved this issue by injecting plotly.js with every iplot call.
While this works, it also injects the library excessively, causing notebooks
to have multiple versions of plotly.js inline in the DOM, potentially making
notebooks with many `iplot` calls very large.
Version 1.10.0 brings back the requirement to call `init_notebook_mode` before
making an `iplot` call. It makes `init_notebook_mode` idempotent: you can call
it multiple times without worrying about losing your plots on refresh.
## [1.9.13] - 2016-05-19
### Fixed
- Fixed issue in offline mode related to the inability to reload plotly.js on page refresh and extra init_notebook_mode calls.
## [1.9.12] - 2016-05-16
### Added
- SSL support for streaming.
## [1.9.11] - 2016-05-02
### Added
- The FigureFactory can now create scatter plot matrices with `.create_scatterplotmatrix`. Check it out with:
import plotly.tools as tls help(tls.FigureFactory.create_scatterplotmatrix)
## [1.9.10] - 2016-04-27
### Updated
- Updated plotly.min.js so the offline mode is using plotly.js v1.10.0
- Added beta versions of two new 2D WebGL trace types: heatmapgl, contourgl
- Added fills for scatterternary traces
- Added configurable shapes layer positioning with the shape attribute: `layer`
## [1.9.9] - 2016-04-15
### Fixed
- Fixed `require is not defined` issue when plotting offline outside of Ipython Notebooks.
## [1.9.8] - 2016-04-14
### Fixed
- Error no longer results from a "Run All" cells when working in a Jupyter Notebook.
### Updated
- Updated plotly.min.js so offline is using plotly.js v1.9.0
- Added Ternary plots with support for scatter traces (trace type `scatterternary`, currently only available in offline mode)
- For comprehensive update list see the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)
## [1.9.7] - 2016-04-04
### Fixed
- Offline mode will no longer delete the Jupyter Notebook's require, requirejs, and define variables.
### Updated
- Updated plotly.min.js so offline is using plotly.js v1.8.0
- Added range selector functionality for cartesian plots
- Added range slider functionality for scatter traces
- Added custom surface color functionality
- Added ability to subplot multiple graph types (SVG cartesian, 3D, maps, pie charts)
- For comprehensive update list see the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)
## [1.9.6] - 2016-02-18
### Updated
- Updated plotly.min.js so offline is using plotly.js v1.5.2
## [1.9.5] - 2016-01-17
### Added
- Offline matplotlib to Plotly figure conversion. Use `offline.plot_mpl` to convert and plot a matplotlib figure as a Plotly figure independently of IPython/Jupyter notebooks or use `offline.iplot_mpl` to convert and plot inside of IPython/Jupyter notebooks. Additionally, use `offline.enable_mpl_offline` to convert and plot all matplotlib figures as plotly figures inside an IPython/Jupyter notebook. See examples below:
An example independent of IPython/Jupyter notebooks:
from plotly.offline import init_notebook_mode, plot_mpl import matplotlib.pyplot as plt
init_notebook_mode()
fig = plt.figure() x = [10, 15, 20] y = [100, 150, 200] plt.plot(x, y, "o")
plot_mpl(fig)
An example inside of an IPython/Jupyter notebook:
from plotly.offline import init_notebook_mode, iplot_mpl import matplotlib.pyplot as plt
init_notebook_mode()
fig = plt.figure() x = [10, 15, 20] y = [100, 150, 200] plt.plot(x, y, "o")
iplot_mpl(fig)
An example of enabling all matplotlib figures to be converted to
Plotly figures inside of an IPython/Jupyter notebook:
from plotly.offline import init_notebook_mode, enable_mpl_offline import matplotlib.pyplot as plt
init_notebook_mode() enable_mpl_offline()
fig = plt.figure() x = [10, 15, 20, 25, 30] y = [100, 250, 200, 150, 300] plt.plot(x, y, "o") fig
## [1.9.4] - 2016-01-11
### Added
- Offline plotting now works outside of the IPython/Jupyter notebook. Here's an example:
from plotly.offline import plot from plotly.graph_objs import Scatter
plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])])
This command works entirely locally. It writes to a local HTML file with the necessary [plotly.js](https://plot.ly/javascript) code to render the graph. Your browser will open the file after you make the call.
The call signature is very similar to `plotly.offline.iplot` and `plotly.plotly.plot` and `plotly.plotly.iplot`, so you can basically use these commands interchangeably.
If you want to publish your graphs to the web, use `plotly.plotly.plot`, as in:
import plotly.plotly as py from plotly.graph_objs import Scatter
py.plot([Scatter(x=[1, 2, 3], y=[5, 1, 6])])
This will upload the graph to your online plotly account.
## [1.9.3] - 2015-12-08
### Added
- Check for `no_proxy` when determining if the streaming request should pass through a proxy in the chunked_requests submodule. Example: `no_proxy='my_stream_url'` and `http_proxy=my.proxy.ip:1234`, then `my_stream_url` will not get proxied. Previously it would.
## [1.9.2] - 2015-11-30
**Bug Fix**: Previously, the "Export to plot.ly" link on
offline charts would export your figures to the
public plotly cloud, even if your `config_file`
(set with `plotly.tools.set_config_file` to the file
`~/.plotly/.config`) set `plotly_domain` to a plotly enterprise
URL like `https://plotly.acme.com`.
This is now fixed. Your graphs will be exported to your
`plotly_domain` if it is set.
## [1.9.1] - 2015-11-26
### Added
- The FigureFactory can now create annotated heatmaps with `.create_annotated_heatmap`. Check it out with:
import plotly.tools as tls help(tls.FigureFactory.create_annotated_heatmap)
- The FigureFactory can now create tables with `.create_table`.
import plotly.tools as tls help(tls.FigureFactory.create_table)
## [1.9.0] - 2015-11-15
- Previously, using plotly offline required a paid license.
No more: `plotly.js` is now shipped inside this package to allow
unlimited free use of plotly inside the ipython notebook environment.
The `plotly.js` library that is included in this package is free,
open source, and maintained independently on GitHub at
[https://github.com/plotly/plotly.js](https://github.com/plotly/plotly.js).
- The `plotly.js` bundle that is required for offline use is no longer downloaded
and installed independently from this package: `plotly.offline.download_plotlyjs`
is **deprecated**.
- New versions of `plotly.js` will be tested and incorporated
into this package as new versioned pip releases;
`plotly.js` is not automatically kept in sync with this package.
## [1.8.12] - 2015-11-02
- *Big data* warning mentions `plotly.graph_objs.Scattergl` as possible solution.
## [1.8.9] - 2015-10-11
- If you're behind a proxy, you can make requests by setting the environmental variable HTTP_PROXY and HTTPS_PROXY (http://docs.python-requests.org/en/v1.0.4/user/advanced/#proxies). This didn't work for streaming, but now it does.
## [1.8.8] - 2015-10-05
- Sometimes creating a graph with a private share-key doesn't work -
the graph is private, but not accessible with the share key.
Now we check to see if it didn't work, and re-try a few times until
it does.
## [1.8.7] - 2015-10-01
### Added
- The FigureFactory can now create dendrogram plots with `.create_dendrogram`.
## [1.8.6] - 2015-09-28
### Fixed
- Saving "world_readable" to your config file via `plotly.tools.set_config` actually works.
### Added
- You can also save `auto_open` and `sharing` to the config file so that you can forget these
keyword argument in `py.iplot` and `py.plot`.
## [1.8.5] - 2015-09-29
### Fixed
- Fixed validation errors (validate=False workaround no longer required)
### Added
- Auto-sync API request on import to get the latest schema from Plotly
- `.`-access for nested attributes in plotly graph objects
- General `.help()` method for plotly graph objects
- Specific attribute `.help(<attribute>)` also included
### Removed
- No more *is streamable*, streaming validation.
## [1.8.3] - 2015-08-14
### Fixed
- Fixed typos in `plot` and `iplot` documentations
## [1.8.2] - 2015-08-11
### Added
- CHANGELOG
- `sharing` keyword argument for `plotly.plotly.plot` and `plotly.plotly.iplot` with options `'public' | 'private' | 'secret'` to control the privacy of the charts. Depreciates `world_readable`
### Changed
- If the response from `plot` or `iplot` contains an error message, raise an exception
### Removed
- `height` and `width` are no longer accepted in `iplot`. Just stick them into your figure's layout instead, it'll be more consistent when you view it outside of the IPython notebook environment. So, instead of this:
py.iplot([{'x': [1, 2, 3], 'y': [3, 1, 5]}], height=800)
do this:
py.iplot({
'data': [{'x': [1, 2, 3], 'y': [3, 1, 5]}],
'layout': {'height': 800}
})
`
iplot
respects the figure's height in layout