Allow passing of plotly / iplot parameters into OrbitPlotter3D()
See original GitHub issueIt would be useful to be able to pass plotly iplot
function parameters when calling OrbitPlotter3D()
:
#/via https://plot.ly/python/offline/
#Help on function iplot in module plotly.offline.offline:
iplot(figure_or_data,
show_link=True,
link_text='Export to plot.ly',
validate=True,
image=None,
filename='plot_image',
image_width=800,
image_height=600)
This would allow control over things like the display of the link to plotly (show_link
), the image type used when grabbing and downloading a snapshot of the current orientation of a 3D plot (image
) and the filename it is saved with (filename
).
At the moment, no parameters are passed into iplot()
.
From https://github.com/poliastro/poliastro/blob/master/src/poliastro/plotting.py:
def show(self, **layout_kwargs):
"""Shows the plot in the Notebook.
"""
self._prepare_plot(**layout_kwargs)
iplot(self.figure)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Plotly express arguments in Python
Arguments can either be passed as dataframe columns, or as column names if the data_frame argument is provided. Passing columns as arguments¶. In...
Read more >Configuration in Python - Plotly
You can set the configuration options for your figure by passing a dictionary to this parameter which contains the options you want to...
Read more >Plotly express wide-form support in Python
Over 26 examples of Plotly Express Wide-Form Support including changing color, size, log axes, and more in Python.
Read more >plotly.graph_objects.Figure — 5.11.0 documentation
A dict of string/value properties that will be passed to the Layout constructor ... or allows those events to pass through to data...
Read more >Creating and updating figures in Python - Plotly
add_trace() etc) as described below. Graph object constructors and update methods accept "magic underscores" (e.g. go.Figure(layout_title_text="The Title") ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 on renaming
_prepare_plot
tostyle_plot
and keep everything the same!Note: This code is incomplete because
show
should have**iplot_kwargs
instead, see comments below.The interesting part is adding a test for it. Do you want to give it a try?
@Juanlu001 Re: options.
I’d considered allowing options in to
OrbitPlotter*D
but it feels to me that that’s too early to commit to theiplot
. It would mean the output parameters are required before you build up the plot, rather than just as you are about to plot it, and they are hanging around all the way through the plotting process?If
_prepare_plot()
was public then how would it work? Maybe rename it asstyle_plot()
, becuase that feels more explicit?That feels reasonably natural? (I’m also assuming that
self._redraw_attractor()
andself._layout()
are independent on each other and have no side-effects either way?)How would making the
layout
property public work? What commands would folk be running where? Maybe:This would require some checking for references to
_layout
elsewhere; for consistency, but then should_layout
in other classes have to go public too? Maybe this has too many side-effects?