Remove pylab.ion() from plot_image.py's main().
[parallel_computing.git] / src / plot_image / plot_image.py
index 9eaaa205d30cbcbdf75ef91b9e338d172aa99c7b..591a7f4e64611de2f9cc9150daac3329e6fcab79 100755 (executable)
@@ -149,9 +149,9 @@ def plot(X, Y, Z, full=False, title=None, contours=None, cmap=None):
 
     fig = pylab.figure()
     if full:
-        axes = pylab.axes([0, 0, 1, 1])
+        axes = fig.add_axes([0, 0, 1, 1])
     else:
-        axes = pylab.axes()
+        axes = fig.add_subplot(1, 1, 1)
         if title:
             axes.set_title(title)
     axes.set_axis_off()
@@ -159,7 +159,7 @@ def plot(X, Y, Z, full=False, title=None, contours=None, cmap=None):
     if contours:
         cset = axes.contour(X[:-1,:-1], Y[:-1,:-1], Z, contours, cmap=cmap)
         # [:-1,:-1] to strip dummy last row & column from X&Y.
-        pylab.clabel(cset, inline=1, fmt='%1.1f', fontsize=10)
+        axes.clabel(cset, inline=1, fmt='%1.1f', fontsize=10)
     else:
         # pcolor() is much slower than imshow.
         #plot = axes.pcolor(X, Y, Z, cmap=cmap, edgecolors='none')
@@ -279,7 +279,6 @@ def main(argv=None):
     if options.output:
         fig.savefig(options.output)
     else:
-        pylab.ion()
         pylab.show()