soybeans_trends / line_plot.py
gdalbo's picture
Upload 22 files
012df4b
Raw
History Blame Contribute Delete
742 Bytes
from plotly.subplots import make_subplots
import plotly.graph_objects as go
def line_plot(x, y, title):
fig = make_subplots(rows = 1, cols = 1, shared_xaxes = True, vertical_spacing = 0.02)
fig.add_trace(go.Scatter(x = x, y = y,
name = "Retorno acumulado", line = dict(color = "green")), row = 1, col = 1)
fig. update_layout(height = 600, width = 1000,
title_text = title,
title_font_color = "black",
xaxis_title = "Data",
yaxis_title = "Retorno acumulado (%)",
legend_title = "Retorno acumulado",
font = dict(size = 10, color = "black"))
return fig