Python Forum

Full Version: Python Matplotlib: How do I plot lines with different end point in the same graph?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

Basically I have Revenue that ends at year 2000 and Profit that ends at year 1998. I want to plot both set of data on the same graph.

I read in the data from Excel file. But for Profit, the missing data from 1999 and 2000 cause Python to impute a value for the missing data at Year 1999 & 2000 in the Graph.

How do I make the line for Profit to stop at Year 1998 in the graph? Thank you


Year Revenue Profit
1990 1 2
1991 1 2
1992 1 2
1993 1 2
1994 1 2
1995 1 2
1996 1 2
1997 1 2
1998 1 2
1999 1
2000 1