Python Forum
Plot several graphs in one plot
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plot several graphs in one plot
#1
Hi,
I will use an easy example to ask my question:

time1=[1,2,3,4,5,6] (sek)
time2=[0.5,2,5,6,7.5,8.6,10] (sek)

y1=[20,40,60,80,90,100] (N)
y2=[10,15,30,60,70,90,110] (N)

Both time-arrays and y-arrays have the same units, but they have different lengths and values.
Is it possible to plot them together so that they can be compared directly? - meaning: plt.plot(time1, y1) and plt.plot(time2, y2) plotted together

Thank you
Reply
#2
It is possible, even easy. What have you tried?

Matplotlib has examples for doing almost anything. You can look at the examples:

https://matplotlib.org/stable/gallery/index.html

or tutorials:

https://matplotlib.org/stable/tutorials/...-pyplot-py
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Value Error when Trying to Plot Filtered Waveforms mkohler 1 184 May-09-2024, 05:33 PM
Last Post: deanhystad
  Plot function Sedos101 3 849 Aug-23-2023, 02:53 PM
Last Post: deanhystad
  Likert survey data plot error Andrzej_Andrzej 6 1,541 Jul-16-2023, 10:11 PM
Last Post: deanhystad
  Error when animating 3D plot Tee 4 1,052 Jul-03-2023, 08:49 PM
Last Post: Tee
  Plot multiple 2D Curves in 3D stc 5 1,085 Jun-11-2023, 05:48 PM
Last Post: snippsat
  Plot a pandas data fram via pyqtgraph with an modul import and qt designer widget Nietzsche 0 881 May-29-2023, 02:42 PM
Last Post: Nietzsche
  first time use plot - I get empty graph korenron 6 2,239 Feb-04-2023, 02:14 PM
Last Post: deanhystad
  Create simple live plot of stock data dram 2 2,989 Jan-27-2023, 04:34 AM
Last Post: CucumberNox
Thumbs Up Python 3 Jupyter notebook ternary plot data nicholas 0 989 Jan-21-2023, 05:01 PM
Last Post: nicholas
  For Loop: To see plot for different columns JaneTan 0 1,008 Dec-14-2022, 05:55 AM
Last Post: JaneTan

Forum Jump:

User Panel Messages

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