Skip to content

Instantly share code, notes, and snippets.

@jjsantanna
Created July 17, 2018 08:45
Show Gist options
  • Save jjsantanna/c71d90f1f39029917edb26f67eddb02f to your computer and use it in GitHub Desktop.
Save jjsantanna/c71d90f1f39029917edb26f67eddb02f to your computer and use it in GitHub Desktop.
Example plotly
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import plotly
plotly.offline.init_notebook_mode()
# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s)
ax.set(xlabel='time (s)', ylabel='voltage (mV)', title='About as simple as it gets, folks')
ax.grid()
# plt.show()
plotly.offline.iplot_mpl(fig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment