source: lmdz_wrf/trunk/tools/documentation/plotting/2Dshad_2cont.html @ 1559

Last change on this file since 1559 was 1465, checked in by lfita, 8 years ago

Adding:

  • `draw_2D_shad_2cont': plotting three fields, one with shading and the other two with contour lines
  • `draw_ptZvals': Function to plot a given list of points by their Z value and a colorbar
  • `draw_vectors': Function to plot wind vectors
File size: 7.0 KB
Line 
1<HTML>
2  <HEAD>
3    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8"/>
4    <LINK REL="stylesheet" TYPE="text/css" HREF="../PyNCplot.css"/>
5  </HEAD>
6
7  </HEAD>
8  <BODY>
9    <DIV CLASS="valheader">
10      2D shadow 2 contour plot
11    </DIV>
12    <DIV CLASS="valimg">
13      Plotting three 2D fields one with shading 2 with contour lines
14      <IMG WIDTH="100%" SRC="figs/2Dfields_shadow-2contour.png"></IMG>
15    </DIV>
16    <DIV CLASS="valhelp">
17    draw_2D_shad_2cont(ncfile, values, varn)<BR>
18    &nbsp;&nbsp;ncfile= [ncfilevars],[ncfilevarc1],[ncfilevarc2] files to use (one value, same file)<BR>
19    &nbsp;&nbsp;values=[vnamefs],[vnamefc1],[vnamefc2]:[dimvals]:[dimvalc1]:[dimvalc2]:[dimxvn]:[dimyvn]:[dimxyfmt]:[colorbarvals]:<BR>
20    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ckind1]:[clabfmt1]:[ckind2]:[clabfmt2]:[sminv],[smaxv]:[sminc1],[smaxc1],[Nlev1]:[sminc2],[smaxc2],[Nlev2]:<BR>
21    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[figt]:[kindfig]:[reverse]:[mapv]:[close]<BR>
22    &nbsp;&nbsp;&nbsp;&nbsp;[vnamefs],[vnamefc1],[vnamefc2]: Name in the figure of the shaded and the contour variable1 and contour variable2<BR>
23    &nbsp;&nbsp;&nbsp;&nbsp;[dimvals/c1/c2]: ',' list of [dimname]|[value] telling at which dimension of the <BR>
24    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;variable a given value is required:<BR>
25    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [integer]: which value of the dimension<BR>
26    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -1: all along the dimension<BR>
27    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -9: last value of the dimension<BR>
28    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [beg]@[end]@[inc] slice from [beg] to [end] every [inc]<BR>
29    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* NOTE, no dim name all the dimension size<BR>
30    &nbsp;&nbsp;&nbsp;&nbsp;[dimx/yvn]: names of the variables with the values of the dimensions for the plot<BR>
31    &nbsp;&nbsp;&nbsp;&nbsp;[dimxyfmt]=[dxf],[Ndx],[dyf],[Ndy]: format of the values at each axis<BR>
32    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxs]: style of x-axis ('auto' for 'pretty')<BR>
33    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Nfix', values computed at even 'Ndx'<BR>
34    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Vfix', values computed at even 'Ndx' increments<BR>
35    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10)<BR>
36    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxf]: format of the labels at the x-axis<BR>
37    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndx]: Number of ticks at the x-axis<BR>
38    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordx]: angle of orientation of ticks at the x-axis ('auto' for horizontal)<BR>
39    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dys]: style of y-axis ('auto' for 'pretty')<BR>
40    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dyf]: format of the labels at the y-axis<BR>
41    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndy]: Number of ticks at the y-axis<BR>
42    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)<BR>
43    &nbsp;&nbsp;&nbsp;&nbsp;[colorbarvals]=[colbarn],[fmtcolorbar],[orientation]<BR>
44    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[colorbarn]: name of the color bar<BR>
45    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[fmtcolorbar]: format of the numbers in the color bar 'C'-like ('auto' for %6g)<BR>
46    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[orientation]: orientation of the colorbar ('vertical' (default, by 'auto'), 'horizontal')<BR>
47    &nbsp;&nbsp;&nbsp;&nbsp;[ckind1/2]: kind of contours for variable 1 andf variable 2<BR>
48    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cmap': as it gets from colorbar<BR>
49    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'fixc,[colname]': fixed color [colname], all stright lines<BR>
50    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'fixsigc,[colname]': fixed color [colname], &gt;0 stright, &lt;0 dashed  line<BR>
51    &nbsp;&nbsp;&nbsp;&nbsp;[clabfmt1/2]: format of the labels in the contour 1 and 2 (C-like 'None', also possible)<BR>
52    &nbsp;&nbsp;&nbsp;&nbsp;[smin/axv]: minimum and maximum value for the shading or<BR>
53    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Srange': for full range<BR>
54    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Saroundmean@val': for mean-xtrm,mean+xtrm where xtrm = np.min(mean-min@val,max@val-mean)<BR>
55    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Saroundminmax@val': for min*val,max*val<BR>
56    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Saroundpercentile@val': for median-xtrm,median+xtrm where xtrm = np.min(median-percentile_(val),<BR>
57    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;percentile_(100-val)-median)<BR>
58    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Smean@val': for -xtrm,xtrm where xtrm = np.min(mean-min*@val,max*@val-mean)<BR>
59    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Smedian@val': for -xtrm,xtrm where xtrm = np.min(median-min@val,max@val-median)<BR>
60    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Spercentile@val': for -xtrm,xtrm where xtrm = np.min(median-percentile_(val),<BR>
61    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;percentile_(100-val)-median)<BR>
62    &nbsp;&nbsp;&nbsp;&nbsp;[sminc1/2]:[smaxv1/2]:[Nlev1/2]: minimum, maximum and number of values for the contour 1 and 2<BR>
63    &nbsp;&nbsp;&nbsp;&nbsp;[figt]: title of the figure ('|' for spaces)<BR>
64    &nbsp;&nbsp;&nbsp;&nbsp;[kindfig]: kind of figure<BR>
65    &nbsp;&nbsp;&nbsp;&nbsp;[reverse]: does the values be transposed? 'True/False',<BR> 
66    &nbsp;&nbsp;&nbsp;&nbsp;[mapv]: map characteristics: [proj],[res]<BR>
67    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;see full documentation: <A HREF="http://matplotlib.org/basemap/" TARGET="_blank" CLASS="lc">http://matplotlib.org/basemap/</A><BR>
68    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[proj]: projection<BR>
69    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'cyl', cilindric<BR>
70    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'lcc', lamvbert conformal<BR>
71    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[res]: resolution:<BR>
72    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'c', crude<BR>
73    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'l', low<BR>
74    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'i', intermediate<BR>
75    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'h', high<BR>
76    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'f', full<BR>
77    &nbsp;&nbsp;&nbsp;&nbsp;[close]: Whether figure should be finished or not<BR>
78    &nbsp;&nbsp;varn= [varsn],[varcn1],[varcn2] name of the variable to plot with shading variable with contour 1 and contour 2<BR>
79    </DIV>
80    <DIV CLASS="valins">
81      python ${pyHOME}/drawing.py -o draw_2D_shad_2cont -f out/hur_157_100000_20051212120000-20051216120000.nc,out/z_129_30000_20051212120000-20051216120000.nc,out/psl_151_sfc_20051212120000-20051216120000.nc -S 'hur@100000,z@30000,psl@sfc:time|5,lev|0,lat|-1,lon|-1:time|5,lev|0,lat|-1,lon|-1:time|5,lev|0,lat|-1,lon|-1:lon:lat:auto:BuPu,auto,auto:fixc,green:None:fixc,red:None:60.,100.:82000.,93000.,8:99000.,104000.,8:hur@100000|z@30000|psl@sfc|on|20051213180000:png:flip@y:cyl,l:yes' -v hur,z,psl
82    </DIV>
83  </BODY>
84</HTML>
85
Note: See TracBrowser for help on using the repository browser.