Created
July 31, 2019 20:08
-
-
Save Raudcu/9e1038a47fa3a99d9a583e8076ffc701 to your computer and use it in GitHub Desktop.
This file contains 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
import matplotlib.pyplot as plt | |
import plotly.graph_objs as go | |
import plotly.tools as tls | |
import numpy as np | |
fig, ax = plt.subplots() | |
x = np.linspace(0, 10) | |
ax.plot(x, np.sin(x), '--', linewidth=2) | |
ax.plot(x, np.cos(x), '--', linewidth=2) | |
plotly_fig = tls.mpl_to_plotly(fig) | |
plotly_fig['layout']['showlegend'] = True | |
fig = go.Figure(plotly_fig) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment