Plot several graphs in one plot - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Plot several graphs in one plot (/thread-41938.html) |
Plot several graphs in one plot - Ferdiss - Apr-11-2024 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 RE: Plot several graphs in one plot - deanhystad - Apr-11-2024 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.html#sphx-glr-tutorials-pyplot-py |