0

I am trying to graph multiple lines in matplotlib.

I have used to the label function but it is not displaying it.

Here is my code.

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.pyplot import plot

adani = pd.read_csv(r'F:\Pycharm_projects\pytorch_bliztz\nifty50-stock-market-data\ADANIPORTS.csv')
asianpaint = pd.read_csv(r'F:\Pycharm_projects\pytorch_bliztz\nifty50-stock-market-data\ASIANPAINT.csv')
adani1 = adani.High
asian_paint = asianpaint.High
plt.plot(asian_paint, label="asian_paint")
plt.plot(adani1, label='adaini1')

plt.show()

Here is my image:

enter image description here

0

1 Answer 1

0

You need to add the following command after plotting

plt.legend()
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.