Python Forum
Multiple plots with matplotlib - looping
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple plots with matplotlib - looping
#5
Thanks Crimson King, I was looking for solution for showing all plots at same time on different graphs.

I still have issues when I want to show two graphs (with different functions on them). e.g.:


for i in plot_list1:
   plt.plot(i)
plt.show

for j in plot_list2:
   plt.plot()
plt.show
I get the second graph shown only after closing first one. Do you know how to get both graphs shown at same time, without having to close one first?

Ok, I somehow found the answer, though I can't really say I know how it works...

before each plot, I should add the line:
plt.figure()
like this:


plt.figure()
for i in plot_list1:
  plt.plot(i)

plt.figure()
for j in plot_list2:
  plt.plot()

plt.show
Reply


Messages In This Thread
RE: Multiple plots with matplotlib - looping - by j.crater - Sep-22-2016, 06:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple Plots in Spyder PythonAndMe2023 0 906 Feb-03-2023, 07:00 PM
Last Post: PythonAndMe2023
  Trying to loop through code to plot seaborn line plots across multiple subplots eyavuz21 0 1,719 Dec-05-2022, 10:46 AM
Last Post: eyavuz21
  Multiple user defined plots with secondary axes using for loop maltp 1 1,499 Apr-30-2022, 10:19 AM
Last Post: maltp
  Matplotlib multiple set_over / under G_rizzle 0 1,105 Feb-14-2022, 12:13 PM
Last Post: G_rizzle
  Matplotlib - close multple plots with user input Positron79 0 1,778 Dec-01-2021, 05:26 PM
Last Post: Positron79
  Subplot - Plotting 4 plots on the same row Menthix 1 1,453 Nov-07-2021, 09:03 PM
Last Post: deanhystad
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 3,278 Mar-11-2021, 10:52 AM
Last Post: buran
  Sharing X Axis in Sub plots JoeDainton123 1 2,203 Aug-22-2020, 04:11 AM
Last Post: deanhystad
  Help With Sub Plots JoeDainton123 0 1,716 Aug-20-2020, 10:48 PM
Last Post: JoeDainton123
  Group scatter plots Mekala 0 1,677 Jul-23-2020, 02:18 PM
Last Post: Mekala

Forum Jump:

User Panel Messages

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