I am using this link to solve my doubts:

How to plot multiple lines on the same y-axis using Plotly Express in Python

I am trying to plot multiple lines in same plot. Also, I want to add data-labels ( Y-values) on every line that I plot.

Here is the code that I am using:

def plot_func(data):
    
    fig = px.line(data, x="yyyymm", y="sells", color='model')
    fig.show()

The resultant plot is:

enter image description here

I want to add y-values on every line. Also, if you notice my x axis is in format yyyymm which I have converted to string by appending _ at end otherwise plotly converts it to number. Is there a better approach to convert it to dates?

How can I add a vertical dash line where x=201912_ and put title to my plots?

0

There are 0 answers