All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
- a
Gridfromplotly.grid_objsnow accepts apandas.Dataframeas its argument.
plotly.exceptions.PlotlyRequestExceptionis always raised for network failures. Previously either aPlotlyError,PlotlyRequestException, or arequests.exceptions.ReqestExceptioncould be raised. In particular, scripts which depend ontry-exceptblocks containing network requests should be revisited.plotly.py:sign_innow validates to the plotly server specified in your config. If it cannot make a successful request, it raises aPlotlyError.plotly.figure_factorywill raise anImportErrorifnumpyis not installed.plotly.figure_factory.create_violin()now has arugplotparameter which determines whether or not a rugplot is draw beside each violin plot.
plotly.tools.FigureFactory. Useplotly.figure_factory.*.- (optional imports)
plotly.tools._*_importedIt was private anyhow, but now it's gone. (e.g.,_numpy_imported) - (plotly v2 helper)
plotly.py._api_v2It was private anyhow, but now it's gone.
- Python 3.5 has been added as a tested environment for this package.
plotly.plotly.create_animationsandplotly.plotly.icreate_animationsnow return appropriate error messages if the response is not successful.framesare now integrated into GRAPH_REFERENCE and figure validation.
- The plot-schema from
https://api.plot.ly/plot-schemais no longer updated on import.
- Updated
plotly.min.jsto version 1.20.5 forplotly.offline.- See the plotly.js CHANGELOG for additional information regarding the updates
FF.create_scatterplotmatrixnow by default does not show the trace labels for the box plots, only ifdiag=boxis selected for the diagonal subplot type.
- The
link textin the bottom right corner of the offline plots now properly displaysExport to [Domain Name]for the given domain name set in the users'.configfile.
FF.create_violinandFF.create_scatterplotmatrixnow by default do not print subplot grid information in output- Removed alert that occured when downloading plot images offline. Please note: for higher resolution images and more export options, consider making requests to our image servers. See:
help(py.image)for more details.
- Plot configuration options for offline plots. See the list of configuration options and examples for more information.
- Please note that these configuration options are for offline plots ONLY. For configuration options when embedding online plots please see our embed tutorial.
colors.pyfile which contains functions for manipulating and validating colors and arrays of colors- 'scale' param in
FF.create_trisurfwhich now can set the interpolation on the colorscales - animations now work in offline mode. By running
plotly.offline.plot()andplotly.offline.iplot()with afigwithframes, the resulting plot will cycle through the figures defined inframeseither 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_animationsandplotly.plotly.icreate_animationswhich animate a figure with theframesargument. 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)
# create figure
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')
- Trisurf now uses correct
Plotly Colorscaleswhen called - Fixed a bug in the format of unique-identifiers in columns of grids that are uploaded to plotly via
plotly.plotly.upload. See plotly#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])
# Upload the grid
py.grid_ops.upload(g, 'my-grid', auto_open=False)
# Make a graph that with data that is referenced from that grid
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.
- the colorbar in
.create_trisurfnow displays properly inoffline mode.
- the colorbar in
.create_trisurfnow displays the appropriate max and min values on the ends of the bar which corresponding to the coloring metric of the figure edges_coloris now a param in.create_trisurfwhich only takesrgbvalues at the moment
- 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.
- Edited
plotly.min.jsdue to issue usingiplotto plot offline in Jupyter Notebooks- Please note that
plotly.min.jsmay 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 correctplotly.min.jsis referenced.
- Please note that
- Updated
plotly.min.jsfrom 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 for additional information regarding the updates
.create_trisurfnow supports a visible colorbar for the trisurf plots. Check out the docs for help:
import plotly.tools as tls
help(tls.FigureFactory.create_trisurf)
- 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)
- Updated
plotly.min.jsfrom 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 for additional information regarding the updates
- Updated
default-schema
- Added
update_plotlyjs_for_offlinein makefile in order to automate updatingplotly.min.jsfor offline mode
- Updated plotly.min.js so the offline mode is using plotly.js v1.13.0
- Fix
Plotly.toImageandPlotly.downloadImagebug 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 for additional additions and updates.
- Fix
- 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
imageto the existing plot calls, you can now download the images of the plots you make in offline mode.
- Fixed check for the height parameter passed to
_plot_html, and now sets the correctlink textfor plots generated in offline mode.
- The FigureFactory can now create violin plots with
.create_violin. Check it out with:
import plotly.tools as tls
help(tls.FigureFactory.create_violin)
- 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_verificationconfiguration setting.
-
Changed the default option for
create_distplotin the figure factory fromprobabilitytoprobability densityand also added thehistnormparameter 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_scatterplotmatrixandcreate_trisurfto use divergent and categorical colormaps. The parameterpalettehas been replaced bycolormapanduse_palettehas been removed. Increate_scatterplotmatrix, users can now:- Input a list of different color types (hex, tuple, rgb) to
colormapto map colors divergently - Use the same list to categorically group the items in the index column
- Pass a singlton color type to
colormapto color all the data with one color - Input a dictionary to
colormapto map index values to a specific color - 'cat' and 'seq' are valid options for
colormap_type, which specify the type of colormap being used
- Input a list of different color types (hex, tuple, rgb) to
-
In
create_trisurf, the parameterdist_funchas been replaced bycolor_func. Users can now:- Input a list of different color types (hex, tuple, rgb) to
colormapto map colors divergently - Input a list|array of hex and rgb colors to
color_functo assign each simplex to a color
- Input a list of different color types (hex, tuple, rgb) to
- Added the option to load plotly.js from a CDN by setting the parameter
connected=Truein theinit_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)
- Version 1.9.13 fixed an issue in offline mode where if you ran
init_notebook_modemore 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 raninit_notebook_modemore 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 manyiplotcalls very large. Version 1.10.0 brings back the requirement to callinit_notebook_modebefore making aniplotcall. It makesinit_notebook_modeidempotent: you can call it multiple times without worrying about losing your plots on refresh.
- Fixed issue in offline mode related to the inability to reload plotly.js on page refresh and extra init_notebook_mode calls.
- SSL support for streaming.
- 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)
- 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
- Fixed
require is not definedissue when plotting offline outside of Ipython Notebooks.
- Error no longer results from a "Run All" cells when working in a Jupyter Notebook.
- 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
- Added Ternary plots with support for scatter traces (trace type
- Offline mode will no longer delete the Jupyter Notebook's require, requirejs, and define variables.
- 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
- Updated plotly.min.js so offline is using plotly.js v1.5.2
- Offline matplotlib to Plotly figure conversion. Use
offline.plot_mplto convert and plot a matplotlib figure as a Plotly figure independently of IPython/Jupyter notebooks or useoffline.iplot_mplto convert and plot inside of IPython/Jupyter notebooks. Additionally, useoffline.enable_mpl_offlineto 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
- 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 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.
- Check for
no_proxywhen determining if the streaming request should pass through a proxy in the chunked_requests submodule. Example:no_proxy='my_stream_url'andhttp_proxy=my.proxy.ip:1234, thenmy_stream_urlwill not get proxied. Previously it would.
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.
- 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)
- Previously, using plotly offline required a paid license.
No more:
plotly.jsis now shipped inside this package to allow unlimited free use of plotly inside the ipython notebook environment. Theplotly.jslibrary that is included in this package is free, open source, and maintained independently on GitHub at https://github.com/plotly/plotly.js. - The
plotly.jsbundle that is required for offline use is no longer downloaded and installed independently from this package:plotly.offline.download_plotlyjsis deprecated. - New versions of
plotly.jswill be tested and incorporated into this package as new versioned pip releases;plotly.jsis not automatically kept in sync with this package.
- Big data warning mentions
plotly.graph_objs.Scatterglas possible solution.
- 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.
- 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.
- The FigureFactory can now create dendrogram plots with
.create_dendrogram.
- Saving "world_readable" to your config file via
plotly.tools.set_configactually works.
- You can also save
auto_openandsharingto the config file so that you can forget these keyword argument inpy.iplotandpy.plot.
- Fixed validation errors (validate=False workaround no longer required)
- 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
- No more is streamable, streaming validation.
- Fixed typos in
plotandiplotdocumentations
- CHANGELOG
sharingkeyword argument forplotly.plotly.plotandplotly.plotly.iplotwith options'public' | 'private' | 'secret'to control the privacy of the charts. Depreciatesworld_readable
- If the response from
plotoriplotcontains an error message, raise an exception
-
heightandwidthare no longer accepted iniplot. 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} })
- The height of the graph in
iplotrespects the figure's height in layout