From 7528c00772f44dee24c0df7e15d70a4852f171a8 Mon Sep 17 00:00:00 2001 From: Jonathan de Melker Worms Date: Fri, 31 May 2019 12:34:15 +0200 Subject: [PATCH 1/3] bug: Example for the animation_opts argument in the doc strings of plot and iplot functions doesn't work --- plotly/offline/offline.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index 2c676179dff..ccd65392506 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -316,10 +316,11 @@ def iplot(figure_or_data, show_link=False, link_text='Export to plot.ly', `show_link` and `link_text` set the associated options in this dictionary if it doesn't contain them already. auto_play (default=True) -- Whether to automatically start the animation - sequence if the figure contains frames. Has no effect if the figure - does not contain frames. - animation_opts (default=None) -- dict of custom animation parameters to be - passed to the function Plotly.animate in Plotly.js. See + sequence on page load, if the figure contains frames. Has no effect if + the figure does not contain frames. + animation_opts (default=None) -- Dict of custom animation parameters that + are used for the automatically started animation on page load. This + dict is passed to the function Plotly.animate in Plotly.js. See https://github.com/plotly/plotly.js/blob/master/src/plots/animation_attributes.js for available options. Has no effect if the figure does not contain frames, or auto_play is False. @@ -345,7 +346,7 @@ def iplot(figure_or_data, show_link=False, link_text='Export to plot.ly', {'data': [{'x': [1, 4], 'y': [1, 4]}]}, {'data': [{'x': [3, 4], 'y': [3, 4]}], 'layout': {'title': 'End Title'}}]} - iplot(figure,animation_opts="{frame: {duration: 1}}") + iplot(figure, animation_opts={'frame': {'duration': 1}}) ``` """ import plotly.io as pio @@ -492,11 +493,12 @@ def plot(figure_or_data, show_link=False, link_text='Export to plot.ly', auto_play (default=True) -- Whether to automatically start the animation sequence on page load if the figure contains frames. Has no effect if the figure does not contain frames. - animation_opts (default=None) -- dict of custom animation parameters to be - passed to the function Plotly.animate in Plotly.js. See + animation_opts (default=None) -- Dict of custom animation parameters that + are used for the automatically started animation on page load. This + dict is passed to the function Plotly.animate in Plotly.js. See https://github.com/plotly/plotly.js/blob/master/src/plots/animation_attributes.js - for available options. Has no effect if the figure does not contain - frames, or auto_play is False. + for available options. Has no effect if the figure + does not contain frames, or auto_play is False. Example: ``` @@ -509,7 +511,7 @@ def plot(figure_or_data, show_link=False, link_text='Export to plot.ly', {'data': [{'x': [1, 4], 'y': [1, 4]}]}, {'data': [{'x': [3, 4], 'y': [3, 4]}], 'layout': {'title': 'End Title'}}]} - plot(figure,animation_opts="{frame: {duration: 1}}") + iplot(figure, animation_opts={'frame': {'duration': 1}}) ``` """ import plotly.io as pio From 3ddc3318cf1ba0fd35cd8988643188a61ca6bed0 Mon Sep 17 00:00:00 2001 From: Jonathan de Melker Worms Date: Fri, 31 May 2019 12:53:15 +0200 Subject: [PATCH 2/3] space removed --- plotly/offline/offline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index ccd65392506..8dacd962aed 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -322,7 +322,7 @@ def iplot(figure_or_data, show_link=False, link_text='Export to plot.ly', are used for the automatically started animation on page load. This dict is passed to the function Plotly.animate in Plotly.js. See https://github.com/plotly/plotly.js/blob/master/src/plots/animation_attributes.js - for available options. Has no effect if the figure + for available options. Has no effect if the figure does not contain frames, or auto_play is False. Example: @@ -497,7 +497,7 @@ def plot(figure_or_data, show_link=False, link_text='Export to plot.ly', are used for the automatically started animation on page load. This dict is passed to the function Plotly.animate in Plotly.js. See https://github.com/plotly/plotly.js/blob/master/src/plots/animation_attributes.js - for available options. Has no effect if the figure + for available options. Has no effect if the figure does not contain frames, or auto_play is False. Example: From 5239e817aebe7450865e7ef17584cdfb3825134d Mon Sep 17 00:00:00 2001 From: Jonathan de Melker Worms Date: Fri, 31 May 2019 12:57:08 +0200 Subject: [PATCH 3/3] doc string error --- plotly/offline/offline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index 8dacd962aed..f3e6730fb88 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -511,7 +511,7 @@ def plot(figure_or_data, show_link=False, link_text='Export to plot.ly', {'data': [{'x': [1, 4], 'y': [1, 4]}]}, {'data': [{'x': [3, 4], 'y': [3, 4]}], 'layout': {'title': 'End Title'}}]} - iplot(figure, animation_opts={'frame': {'duration': 1}}) + plot(figure, animation_opts={'frame': {'duration': 1}}) ``` """ import plotly.io as pio