- Timestamp:
- Jul 4, 2011, 4:03:07 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/PLOT/PYTHON/scripts/winds.py
r191 r192 19 19 winds=True): 20 20 21 #################################################################################################################### 22 ### Colorbars http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps?action=AttachFile&do=get&target=colormaps3.png 23 21 24 ################################# 22 25 ### Load librairies and functions … … 24 27 from myplot import getcoord2d,define_proj,makeplotpng,simplinterv,vectorfield,ptitle,latinterv,getproj,wrfinterv,dumpbdy 25 28 from matplotlib.pyplot import contourf, subplot, figure, rcParams, savefig, colorbar 29 from matplotlib.cm import get_cmap 26 30 import numpy as np 27 31 … … 193 197 if dimension == 2: what_I_plot = field[:,:] 194 198 elif dimension == 3: what_I_plot = field[i,:,:] 195 contourf( x, y, what_I_plot, 30)199 contourf( x, y, what_I_plot, 30, cmap = get_cmap(name=colorb) ) 196 200 if colorb: colorbar(fraction=0.05,pad=0.1) 197 201 … … 257 261 parser.add_option('-n', action='store', dest='numplot', type="int", default=4, help='number of plots (def=1)(<0: 1 plot of LT -*numplot*)') 258 262 parser.add_option('-i', action='store', dest='interp', type="int", default=None, help='interpolation method (2: press, 3: z-amr, 4:z-als)') 259 parser.add_option('-c', action='store', dest='colorb', type="string", default=None, help='c olorbar')263 parser.add_option('-c', action='store', dest='colorb', type="string", default=None, help='change colormap (and draw a colorbar)') 260 264 parser.add_option('-x', action='store_false', dest='winds', default=True, help='flag: no wind vectors') 261 265 (opt,args) = parser.parse_args()
Note: See TracChangeset
for help on using the changeset viewer.