<p><b>mhoffman@lanl.gov</b> 2013-02-12 15:25:56 -0700 (Tue, 12 Feb 2013)</p><p>BRANCH COMMIT - land ice<br>
Added option to plotting script to print actual cell values.  Activate with -p<br>
</p><hr noshade><pre><font color="gray">Modified: branches/land_ice_projects/grid_tools/animate_mpas_field.py
===================================================================
--- branches/land_ice_projects/grid_tools/animate_mpas_field.py        2013-02-12 22:13:00 UTC (rev 2462)
+++ branches/land_ice_projects/grid_tools/animate_mpas_field.py        2013-02-12 22:25:56 UTC (rev 2463)
@@ -30,6 +30,7 @@
 parser.add_option(&quot;-m&quot;, &quot;--min&quot;, dest=&quot;minimum&quot;, help=&quot;minimum for color bar&quot;, metavar=&quot;MIN&quot;)
 parser.add_option(&quot;-g&quot;, &quot;--log&quot;, action=&quot;store_true&quot;, dest=&quot;log&quot;, help=&quot;include this flag to plot on log scale&quot;, metavar=&quot;LOG&quot;)
 parser.add_option(&quot;-k&quot;, &quot;--mask&quot;, action=&quot;store_true&quot;, dest=&quot;mask&quot;, help=&quot;include this flag to mask non-ice cells with gray&quot;, metavar=&quot;MASK&quot;)
+parser.add_option(&quot;-p&quot;, &quot;--printval&quot;, action=&quot;store_true&quot;, dest=&quot;printval&quot;, help=&quot;include this flag to print numeric cell values (slow)&quot;, metavar=&quot;PRINTVAL&quot;)
 
 options, args = parser.parse_args()
 
@@ -125,33 +126,29 @@
 markersize = 70
 markershape = 'h'
 
-t=0
-plt.scatter(xCell[:], yCell[:], markersize, var_slice[0,:], marker=markershape, edgecolors='none', vmin=minval, vmax=maxval)
-plt.colorbar()
-if options.mask:
-       maskindices = numpy.nonzero(thickness[0,:] &lt;= 0.0)[:]
-       plt.scatter(numpy.take(xCell,maskindices), numpy.take(yCell,maskindices), markersize+2, '0.9', marker=markershape, edgecolors='none')
-plt.title( plottitle + ' at time '+ xtime[0,:].tostring().strip()  )
-plt.draw()
-if options.saveimages:
-        plotname =  varname + '.' + '{0:04d}'.format(t) + '.'  + options.filename + '.png' 
-        plt.savefig(plotname)
-        print 'Saved plot as ' + plotname
 
-
-for t in range(1, time_length):
+for t in range(0, time_length):
     ax.cla()
     plt.scatter(xCell[:], yCell[:], markersize, var_slice[t,:], marker=markershape, edgecolors='none', vmin=minval, vmax=maxval)
+    if t==0:
+            plt.colorbar()
     if options.mask:
        maskindices = numpy.nonzero(thickness[t,:] &lt;= 0.0)[:]
        plt.scatter(numpy.take(xCell,maskindices), numpy.take(yCell,maskindices), markersize+2, '0.9', marker=markershape, edgecolors='none')
+    if options.printval:
+       for iCell in range(xCell[:].shape[0]):
+            plt.text(xCell[iCell], yCell[iCell], '{0:.1f}'.format(var_slice[t,iCell]), horizontalalignment='center', verticalalignment='center',  fontsize=3) 
+       dpi=300
+    else:
+       dpi=150
+
     plt.title( plottitle + ' at time ' + xtime[t,:].tostring().strip() ) #str(t) )
     plt.draw()
     time.sleep(0.05)
     if options.saveimages:
         plotname =  varname + '.' + '{0:04d}'.format(t) + '.'  + options.filename + '.png' 
         #plt.ioff()
-        plt.savefig(plotname)
+        plt.savefig(plotname,dpi=dpi)
         #plt.ion()
         print 'Saved plot as ' + plotname
 

</font>
</pre>