I am trying to use the Python, numpy and matplotlib libraries to do some data analysis and graphing and viewing my stories, adjust my code accordingly, etc. So I need to study the plot. However, running the script from the command line causes the shape to appear instantly and then instantly disappear. Another answer suggested adding a raw_input("text here") at the end of the program to make python wait for input and keep the graphics open. This makes the chart windows open for me, but the actual charts disappear and I just get a blank window with gray shapes while python is waiting for input.
I am running MAC OS X 10.8.3 and using terminal v2.3 , and my installation of python python 2.7.3
import matplotlib.pylab as plt import numpy as np [ .. bunch of calculations .. ] plt.ion() plt.figure("Test Figure") plt.plot(xspace[:],vals[:,50]) raw_input("press key to exit")
source share