Last active
August 11, 2018 02:42
-
-
Save eagleEggs/c441ffa88a90a8a360d771fae3ba2d8e to your computer and use it in GitHub Desktop.
plotly offline graph from command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting up the following will enable running a notebook from CLI and create a plotly image from the generated graph: | |
CLI: | |
sudo jupyter nbconvert --execute notebook.ipynb | |
Python: | |
At top of notebook: offline.init_notebook_mode() | |
After defining data and figure: | |
offline.iplot(fig, filename='graph', image='png') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
py.offline.iplot({‘data’: data, ‘layout’: layout}, filename=‘plot_name’, image=‘png’)
Need to test:
from plotly.offline import init_notebook_mode, plot_mpl
import matplotlib.pyplot as plt