Pandas is a great library for data visualization. Here you’ll see how to plot a line graph in Python with Pandas with some examples.
1. Simple example
Assume that we have a csv file, namely data.csv as follows:
First, let’s import pandas and get input data.
Now, we can plot a line graph for the price of a product varying from 1995 to 2020 in the data.csv file.
Now, you get a line graph as follows
![](https://minhstreaming.com/wp-content/uploads/2022/04/a_line_graph-1.png)
You can see that the above graph doesn’t have a title for y-axis. In case that you need to show the title for y-axis, you can add some lines like this
Then, you have the following graph
![](https://minhstreaming.com/wp-content/uploads/2022/04/a-line-graph.png)
2. Multiple-line graph
How about plotting multiple lines in a graph? Imagine you have data_multiple_line.csv file like this
And you can plot multiple-line graph as follows
Output:
![](https://minhstreaming.com/wp-content/uploads/2022/04/multiple_line_pandas.png)