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
  Embed Matplotlib Graph to Tkinter? dimidgen 0 182 Mar-04-2024, 07:40 PM
Last Post: dimidgen
  What are these python lines for? What are tey doing? Led_Zeppelin 7 1,561 Feb-13-2023, 03:08 PM
Last Post: deanhystad
  first time use plot - I get empty graph korenron 6 1,965 Feb-04-2023, 02:14 PM
Last Post: deanhystad
  Graphic line plot with matplotlib, text file in pytho khadija 2 1,339 Aug-15-2022, 12:00 PM
Last Post: khadija
  DELETE Post using Python FaceBook Graph API BIG_PESH 0 1,423 Mar-24-2022, 08:28 PM
Last Post: BIG_PESH
  How to conditionally specify markers in matplotlib graph Mark17 3 3,124 Mar-03-2022, 07:42 PM
Last Post: Mark17
  plot on the same figure using a for loo with matplotlib drSlump 2 1,668 Oct-13-2021, 07:11 AM
Last Post: drSlump
  matplotlib, no plot when using Figure ajvperth 2 1,652 Oct-12-2021, 02:29 PM
Last Post: ajvperth
  python seems to be skipping lines of code alansandbucket 1 4,088 Jun-22-2021, 01:18 AM
Last Post: Larz60+
  Unable to plot the graph as needed drunkenneo 1 6,263 May-26-2021, 11:04 AM
Last Post: cygnus_X1

Forum Jump:

User Panel Messages

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