source: lmdz_wrf/trunk/tools/documentation/plotting/plot_points.html @ 1553

Last change on this file since 1553 was 1479, checked in by lfita, 8 years ago

Improving `draw_points' by adding background color on 'labelled'

File size: 7.3 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      plot points
11    </DIV>
12    <DIV CLASS="valimg">
13      Plotting a series of lon, lat, labels kept in an ASCII file with the option to add a shaded field
14      <IMG WIDTH="100%" SRC="figs/stations_loc.png"></IMG>
15    </DIV>
16    <DIV CLASS="valhelp">
17    Function to plot a series of points read from an ASCII file with lon, lat, label <BR>
18    draw_points(filen, values)<BR>
19    &nbsp;&nbsp;draw_points(filen, values)<BR>
20    &nbsp;&nbsp;[values]= [ptasciifile]:[gtit]:[dimxyfmt]:[mapvalues]:[kindfigure]:[pointcolor]:[pointlabels]:<BR>
21    &nbsp;&nbsp;&nbsp;&nbsp;[legvals]:[figureko]:[figuren]:[close]<BR>
22    &nbsp;&nbsp;&nbsp;&nbsp;[ptasciifile]:[file],[comchar],[collon],[collat],[lab]<BR>
23    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[file]: column ASCII file with the location of the points<BR>
24    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[comchar]: '|' list of characters for commentaries<BR>
25    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[collon]: number of column with the longitude of the points<BR>
26    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[collat]: number of column with the latitude of the points<BR>
27    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[collab]: number of column with the labels of the points ('None', and will get<BR>
28    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the values from the [pointlabels] variable<BR>
29    &nbsp;&nbsp;&nbsp;&nbsp;[gtit]: title of the figure ('|' for spaces)<BR>
30    &nbsp;&nbsp;&nbsp;&nbsp;[dimxyfmt]: [dxs],[dxf],[Ndx],[ordx],[dys],[dyf],[Ndy],[ordx]: format of the values at each axis (or 'auto')<BR>
31    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxs]: style of x-axis ('auto' for 'pretty')<BR>
32    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Nfix', values computed at even 'Ndx'<BR>
33    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Vfix', values computed at even 'Ndx' increments<BR>
34    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10)<BR>
35    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxf]: format of the labels at the x-axis ('auto' for '%5g')<BR>
36    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndx]: Number of ticks at the x-axis ('auto' for 5)<BR>
37    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordx]: angle of orientation of ticks at the x-axis ('auto' for horizontal)<BR>
38    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dys]: style of y-axis ('auto' for 'pretty')<BR>
39    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dyf]: format of the labels at the y-axis ('auto' for '%5g')<BR>
40    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndy]: Number of ticks at the y-axis ('auto' for 5)<BR>
41    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)<BR>
42    &nbsp;&nbsp;&nbsp;&nbsp;[mapvalues]: drawing coastaline ([proj],[res]) or None<BR>
43    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[proj]: projection<BR>
44    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'cyl', cilindric<BR>
45    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'lcc', lambert conformal<BR>
46    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[res]: resolution:<BR>
47    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'c', crude<BR>
48    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'l', low<BR>
49    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'i', intermediate<BR>
50    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'h', high<BR>
51    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'f', full<BR>
52    &nbsp;&nbsp;&nbsp;&nbsp;[kindfigure]: kind of figure<BR>
53    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'legend': only points in the map with the legend with the names<BR>
54    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'labelled',[txtsize],[txtcol],[txtbckgcol]: points with the names and size, color of text and background <BR>
55    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color ('None' for without)<BR>
56    &nbsp;&nbsp;&nbsp;&nbsp;[pointcolor]: color for the points ('auto' for "red")<BR>
57    &nbsp;&nbsp;&nbsp;&nbsp;[pointlabels]: ',' of labels [only used if [collab]='None'] ('None' for no labels, '!' for spaces)<BR>
58    &nbsp;&nbsp;&nbsp;&nbsp;[legvals]=[locleg]|[fontsize]: <BR>
59    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[locleg]: location of the legend (0, autmoatic)<BR>
60    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',<BR>
61    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',<BR>
62    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9: 'upper center', 10: 'center'<BR>
63    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[fontsize]: font size for the legend (auto for 12)<BR>
64    &nbsp;&nbsp;&nbsp;&nbsp;[figureko]: kind of the output file (pdf, png, ...)<BR>
65    &nbsp;&nbsp;&nbsp;&nbsp;[figuren]: name of the figure<BR>
66    &nbsp;&nbsp;&nbsp;&nbsp;[close]: Whether figure should be finished or not<BR>
67    &nbsp;&nbsp;[filen]= [ncfile],[lonvarn],[latvarn][,[varn],[dimvals],[vargn],[min],[max],[colbarn],[fmtcolorbar],[orientation],[varu]]<BR>
68    &nbsp;&nbsp;&nbsp;&nbsp;[ncfile]: netCDF to use to geolocalize the points<BR>
69    &nbsp;&nbsp;&nbsp;&nbsp;[lonvarn]: name of the variable with the longitudes<BR>
70    &nbsp;&nbsp;&nbsp;&nbsp;[latvarn]: name of the variable with the latitudes<BR>
71    &nbsp;&nbsp;&nbsp;&nbsp;Optional values:<BR>
72    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[varn]: optional variable to add staff into the graph<BR>
73    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimval]: '@' list of [dimn]|[dimval] to get the values for [varn]<BR>
74    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimn]: name of the dimension<BR>
75    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimval]: value of the dimension variable a given value is required:<BR>
76    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [integer]: which value of the dimension<BR>
77    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -1: all along the dimension<BR>
78    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -9: last value of the dimension<BR>
79    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [beg];[end];[inc] slice from [beg] to [end] every [inc]<BR>
80    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* NOTE, no dim name all the dimension size<BR>
81    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[vargn]: name of the variable in the graph<BR>
82    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[min]: minimum value for the extra variable<BR>
83    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[max]: maximum value for the extra variable<BR>
84    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[colbarn]: name of the color bar<BR>
85    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[fmtcolorbar]: format of the numbers in the color bar 'C'-like ('auto' for %6g)<BR>
86    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[orientation]: orientation of the colorbar ('vertical' (default, by 'auto'), 'horizontal')<BR>
87    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[varu]: units of the variable<BR>
88    </DIV>
89    <DIV CLASS="valins">
90      $ python ${pyHOME}/drawing.py -o draw_points -S 'SuperStorm/tslist.dat,#,3,2,1:SuperStorm|sfc|stations:auto:cyl,i:labelled,10,r,None:auto:None:0|12:png:stations_loc:True' -f 'geo_em.d02.nc,XLONG_M,XLAT_M,HGT_M,Time|0@west_east|30;180;1@south_north|175;255;1,height,0.,1500.,terrain,auto,auto,m'
91    </DIV>
92  </BODY>
93</HTML>
94
Note: See TracBrowser for help on using the repository browser.