Python Forum
Python Matplotlib: How do I plot lines with different end point in the same graph?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Matplotlib: How do I plot lines with different end point in the same graph?
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to plot the graph as needed drunkenneo 1 660 May-26-2021, 11:04 AM
Last Post: cygnus_X1
  Python modules to extract data from a graph? bigmit37 5 14,778 Apr-09-2021, 02:15 PM
Last Post: TysonL
  blank graph with matplotlib from a csv file / data type issue arsentievalex 0 450 Apr-06-2021, 10:08 AM
Last Post: arsentievalex
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 757 Mar-11-2021, 10:52 AM
Last Post: buran
  How to plot 3D graph of non numerical value? Gevni 0 681 Mar-05-2021, 02:50 PM
Last Post: Gevni
  Plot Graph quest_ 2 617 Jan-18-2021, 07:58 PM
Last Post: quest_
  How to plot intraday data of several days in one plot mistermister 3 792 Dec-15-2020, 07:43 PM
Last Post: deanhystad
  How to add an image to an existing facebook post using python graph API? Ascalon 0 706 Dec-01-2020, 08:33 PM
Last Post: Ascalon
  Difference Between Figure Axis and Sub Plot Axis in MatplotLib JoeDainton123 2 807 Aug-21-2020, 10:17 PM
Last Post: JoeDainton123
  Understanding The Arguments for matplotlib.pyplot.plot JoeDainton123 0 578 Aug-19-2020, 01:19 AM
Last Post: JoeDainton123

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020