source: lmdz_wrf/trunk/tools/documentation/plotting/bar_line.html @ 1557

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

Replacing '%' seapration file list by '#'

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      bars & lines
11    </DIV>
12    <DIV CLASS="valimg">
13      Function to plot a bar char and lines plot figure with multiple sources
14      <IMG WIDTH="100%" SRC="figs/bar-line_rain_CRU-NCEP_norm.png"></IMG>
15    </DIV>
16    <DIV CLASS="valhelp">
17    draw_bar_line(ncfile, values) <BR>
18    &nbsp;&nbsp;ncfile = '#' list of [filen];[dimslice];[xvarn];[yvarn];[kind] <BR>
19    &nbsp;&nbsp;&nbsp;&nbsp;[filen]: name of the file <BR>
20    &nbsp;&nbsp;&nbsp;&nbsp;[dimslice]: '|' list of [dimn],[dimrange] <BR>
21    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimn]: name of the dimension <BR>
22    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimrange]: range for the slice <BR>
23    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [integer]: which value of the dimension <BR>
24    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -1: all along the dimension <BR>
25    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -9: last value of the dimension <BR>
26    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [beg]@[end]@[inc] slice from [beg] to [end] every [inc] <BR>
27    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* NOTE, no dim name all the dimension size <BR>
28    &nbsp;&nbsp;&nbsp;&nbsp;[xvarn]: name of the variable to use for the x-positions <BR>
29    &nbsp;&nbsp;&nbsp;&nbsp;[yvarn]: name of the variable to use for the values <BR>
30    &nbsp;&nbsp;&nbsp;&nbsp;[kind]: Kind of plotting <BR>
31     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'bar': for bar-plot <BR>
32    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'line': for line-plot <BR>
33    &nbsp;&nbsp;values = [dimxyfmt]:[xaxislab]:[yaxislab]:[xunits]:[yunits]:[aval]:[rangevals]:[labels]: <BR>
34    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[colors]:[wdth]:[colns]:[lines]:[points]:[lwdths]:[psizes]:[freqv]:[graphtit]:[legvalues]: <BR>
35    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[kindfig]:[fign]:[close] <BR>
36    &nbsp;&nbsp;&nbsp;&nbsp;[dimxyfmt]=[dxs],[dxf],[Ndx],[ordx],[dys],[dyf],[Ndy],[ordy]: format of the values at each  <BR>
37     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;axis (or single 'auto' for 'auto','auto') <BR>
38     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxs]: style of x-axis ('auto' for 'pretty') <BR>
39     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Nfix', values computed at even 'Ndx' <BR>
40     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Stringlist', a given list of strings <BR>
41     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Vfix', values computed at even 'Ndx' increments <BR>
42     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10) <BR>
43     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxf]: format of the labels at the x-axis <BR>
44     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndx]: Number of ticks at the x-axis (for 'Stringlist', '@' list of labels) <BR>
45     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordx]: angle of orientation of ticks at the x-axis ('auto' for horizontal) <BR>
46     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dys]: style of y-axis ('auto' for 'pretty') <BR>
47     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dyf]: format of the labels at the y-axis <BR>
48     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndy]: Number of ticks at the y-axis <BR>
49     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal) <BR>
50     &nbsp;&nbsp;&nbsp;&nbsp;[xaxislab]: Label for the x-axis ('!' for spaces) <BR>
51     &nbsp;&nbsp;&nbsp;&nbsp;[yaxislab]: Label for the y-axis ('!' for spaces) <BR>
52     &nbsp;&nbsp;&nbsp;&nbsp;[xunits]: units of the x-label ('None' for no units) <BR>
53     &nbsp;&nbsp;&nbsp;&nbsp;[yunits]: units of the y-label <BR>
54     &nbsp;&nbsp;&nbsp;&nbsp;[aval]: which acis should be used for the values ('x' or 'y') <BR>
55     &nbsp;&nbsp;&nbsp;&nbsp;[rangevals]: Range of the axis with the values (singel 'None' for 'auto','auto') <BR>
56     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[vmin],[vmax]: minimum and maximum values <BR>
57     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'auto': the computed minimumm or maximum of the values   <BR>
58     &nbsp;&nbsp;&nbsp;&nbsp;[labels]: ',' list of labels for the legend ('None' for no-labels, '!' for spaces) <BR>
59     &nbsp;&nbsp;&nbsp;&nbsp;[colors]: ',' list of colors (single value same color, 'auto' automatic) <BR>
60     &nbsp;&nbsp;&nbsp;&nbsp;[wdth]: width of the bars <BR>
61     &nbsp;&nbsp;&nbsp;&nbsp;[colns]= ',' list of color names ('None' for automatic, single value for all the same) <BR>
62     &nbsp;&nbsp;&nbsp;&nbsp;[lines]= ',' list of style of lines ('None' for automatic, single value for all the same) <BR>
63      &nbsp;&nbsp;&nbsp;&nbsp;[points]= '@' list of style of points ('None' for automatic, single value for all the same) <BR>
64      &nbsp;&nbsp;&nbsp;&nbsp;[lwdths]= ',' list of withs of lines ('None' for automatic, single value for all the same) <BR>
65      &nbsp;&nbsp;&nbsp;&nbsp;[psizes]= ',' list of size of points ('None' for automatic, single value for all the same) <BR>
66      &nbsp;&nbsp;&nbsp;&nbsp;[freqv]= frequency of values ('all' for all values) <BR>
67      &nbsp;&nbsp;&nbsp;&nbsp;[graphtit]: title of the figure '!' for spaces <BR>
68      &nbsp;&nbsp;&nbsp;&nbsp;[legvalues]=[locleg]|[fontsize]:  <BR>
69      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[locleg]: location of the legend (0, autmoatic) <BR>
70      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right', <BR>
71      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center', <BR>
72      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9: 'upper center', 10: 'center' <BR>
73      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[fontsize]: font size for the legend (auto for 12) <BR>
74      &nbsp;&nbsp;&nbsp;&nbsp;[kindfig]: kind of output figure (png, pdf, ps) <BR>
75      &nbsp;&nbsp;&nbsp;&nbsp;[fign]: name of the figure (without extension) <BR>
76      &nbsp;&nbsp;&nbsp;&nbsp;[close]: whether figure should be close or not
77    </DIV>
78    <DIV CLASS="valins">
79      $ python ${pyHOME}/drawing.py -o draw_bar_line -f 'Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_norm_meanstd_stat2.nc;time_counter,0@12@1;time_counter;rainnorm;bar#Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_norm_meanstd_stat2.nc;time_counter,12@24@1;time_counter;rainnorm;bar#Forcing_rainstats_OKstomate_CRUNCEP_spinup_SACZ_norm_meanstd_stat2.nc;time_counter,0@12@1;time_counter;rainnorm;line#Forcing_rainstats_OKstomate_CRUNCEP_spinup_SACZ_norm_meanstd_stat2.nc;time_counter,12@24@1;time_counter;rainnorm;line' -S 'Stringlist,%s,January@Feburary@March@April@May@June@July@August@September@October@November@December@Jan@Feb@Mar@Apr@May@Jun@Jul@Aug@Sept@Oct@Nov@Dec,25,pretty,auto,auto,auto:time!since!1958-01-01:pr:x:-4.,4.:seconds:1:$SESA_{1958}$,$SESA_{1959}$,$SACZ_{1958}$,$SACZ_{1959}$:#AA0000,#0000AA:1000000.:#00AA00,#AAAA00:-.:,:2.:2.:all:normalized!evolution!of!precipitation!with!CRU-NCEP!forcing:0|10:png:bar-line_rain_CRU-NCEP_norm:yes'
80    </DIV>
81  </BODY>
82</HTML>
83
Note: See TracBrowser for help on using the repository browser.