Last active
March 15, 2021 21:25
-
-
Save bkaankuguoglu/102399b5d564f5678554ca0e59cf0032 to your computer and use it in GitHub Desktop.
a function that plots plotly graphs
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 plotly.graph_objs as go | |
from plotly.offline import iplot | |
def plot_dataset(df, title): | |
data = [] | |
value = go.Scatter( | |
x=df.index, | |
y=df.value, | |
mode="lines", | |
name="values", | |
marker=dict(), | |
text=df.index, | |
line=dict(color="rgba(0,0,0, 0.3)"), | |
) | |
data.append(value) | |
layout = dict( | |
title=title, | |
xaxis=dict(title="Date", ticklen=5, zeroline=False), | |
yaxis=dict(title="Value", ticklen=5, zeroline=False), | |
) | |
fig = dict(data=data, layout=layout) | |
iplot(fig) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment