1

I can successfully plot using python and matplotlib on the Atom IDE. However, if I plot two or more figures, only a single figure window appears with the first plot and to see the other figures I must close the initial window in which case the next figure will generate and display. I cannot see all the figures simultaneously I have to close the figure tab one by one to see the different figures. Example code:

import matplotlib.pyplot as plt
import numpy as np

t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)
plt.figure()
plt.plot(t, s)

plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
plt.title('About as simple as it gets, folks')
plt.grid(True)
plt.show()

plt.figure()
plt.plot(t, s)

plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
plt.title('About as simple as it gets, folks')
plt.grid(True)
plt.show()

Any help or suggestions would be greatly appreciated, thanks in advance

VitaminG
  • 11
  • 1
  • 3

1 Answers1

0

You answered your question yourself, but if I may : try looking into subplots. ;)

It will allow you to draw multiple things, on separate plot, but on the same figure.

IMCoins
  • 3,149
  • 1
  • 10
  • 25