Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save william-r-s/22d5dfb3365e26209dc348b89abc0402 to your computer and use it in GitHub Desktop.
Save william-r-s/22d5dfb3365e26209dc348b89abc0402 to your computer and use it in GitHub Desktop.
Ploty + matplotlib in hydrogen
import matplotlib.pyplot as plt
import numpy as np
import plotly.tools as tls
from plotly import offline as py
py.init_notebook_mode()
plt.ioff()
t = np.linspace(0, 20, 500)
def showi(*args, **kwargs):
py.iplot(tls.mpl_to_plotly(plt.gcf()))
# plt.close()
showi(plt.plot(t, np.sin(t)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment