Skip to content Skip to sidebar Skip to footer

Plotting Multiple Graphs In Separate Tkinter Figures Within The Same Window

I'm trying to create a GUI using tkinter that will plot multiple plots when prompted. Right now my code works and it plots all of the graphs onto one figure. I would like to plot t

Solution 1:

You simply need to use the Frame widgets.

You can have more than one frame in the same window so you create each frame you need for each graph and work with them that way.

Seeing that you are already using frames it should not be hard for you to set up.

Solution 2:

you need to put parameter in the subplot method.

plt.subplot(421)
plt.xlabel('Time in seconds')
plt.ylabel('Amplitude')
plt.title('%s HeartBeat ..' % beat_file1)
plt.plot(timeArray1, Y_filtered1)

plt.subplot(422)
plt.xlabel('Time in seconds')
plt.ylabel('Amplitude')
plt.title('%s HeartBeat ..' % beat_file2)
plt.plot(timeArray2, Y_filtered2)

There is an example here : https://matplotlib.org/users/pyplot_tutorial.html

Post a Comment for "Plotting Multiple Graphs In Separate Tkinter Figures Within The Same Window"