Changeset 17654
- Timestamp:
- 04/04/14 19:47:11 (11 years ago)
- Location:
- issm/trunk-jpl/src/m/plot
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/plot_manager.py
r17497 r17654 1 2 1 try: 3 2 import pylab as p … … 11 10 from plot_unit import plot_unit 12 11 from applyoptions import applyoptions 12 from plot_overlay import plot_overlay 13 13 14 14 def plot_manager(md,options,subplotwidth,nlines,ncols,i): … … 24 24 #parse options and get a structure of options 25 25 options=checkplotoptions(md,options) 26 #print 'options:', options27 26 28 27 #get data to be plotted 29 28 data=options.getfieldvalue('data'); 29 30 #initialize plot handle variable 31 handle=None 32 33 ##basemap plot 34 #if options.exist('basemap'): 35 # plot_basemap(md,data,options,nlines,ncols,i) 36 37 #overlay plot 38 if options.exist('overlay'): 39 handle=plot_overlay(md,data,options,nlines,ncols,i) 40 options.addfielddefault('alpha',0.5) 41 options.addfielddefault('xlim',[min(md.mesh.x),max(md.mesh.x)]) 42 options.addfielddefault('ylim',[min(md.mesh.y),max(md.mesh.y)]) 30 43 31 44 #figure out if this is a special plot … … 36 49 plot_mesh(md,options,nlines,ncols,i) 37 50 return 51 elif data.lower()=='none': 52 print 'no data provided to plot (TODO: write plot_none.py)' 53 return 38 54 else: 39 55 print "WARNING: '%s' is not implemented or is not a valid string for option 'data'" % data … … 42 58 #else: 43 59 #print "'data' not a string, plotting model properties yet to be implemented..." 44 45 #Overlay plot46 60 47 61 #Gridded plot … … 56 70 57 71 #standard plot 58 p.subplot(nlines,ncols,i,aspect='equal') 72 if not handle: 73 p.subplot(nlines,ncols,i,aspect='equal') 59 74 60 75 #plot unit -
issm/trunk-jpl/src/m/plot/plot_unit.py
r17643 r17654 21 21 #number of colorlevels for plots 22 22 colorlevels=options.getfieldvalue('colorlevels',256) 23 23 24 alpha=options.getfieldvalue('alpha',1) 25 24 26 #colormap 25 27 cmap=options.getfieldvalue('colormap',mpl.cm.gnuplot2) … … 50 52 #node plot 51 53 if is2d: 52 p.tricontourf(x,y,elements,data,colorlevels,cmap=cmap,norm=norm )54 p.tricontourf(x,y,elements,data,colorlevels,cmap=cmap,norm=norm,alpha=alpha) 53 55 if edgecolor != 'None': 54 56 p.triplot(x,y,elements,color=edgecolor)
Note:
See TracChangeset
for help on using the changeset viewer.