Changeset 1489 in lmdz_wrf


Ignore:
Timestamp:
Apr 3, 2017, 8:08:50 PM (8 years ago)
Author:
lfita
Message:

Improving `draw_lines_time':

  • Including '*' for no label in legend
  • Fixing some text in graph by introducing `latex_text'
Location:
trunk/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/documentation/plotting/Nlines_time.html

    r1403 r1489  
    3434    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndy]: Number of ticks at the y-axis ('auto' for 5)<BR>
    3535    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)<BR>
    36     &nbsp;&nbsp;&nbsp;&nbsp;[leglabels]: ',' separated list of names for the legend ('None', no legend '!' for spaces)<BR>
     36    &nbsp;&nbsp;&nbsp;&nbsp;[leglabels]: ',' separated list of names for the legend ('None', no legend '!' for spaces, '*' for no label)<BR>
    3737    &nbsp;&nbsp;&nbsp;&nbsp;[vartit]: name of the variable in the graph<BR>
    3838    &nbsp;&nbsp;&nbsp;&nbsp;[title]: title of the plot ('|' for spaces)<BR>
  • trunk/tools/drawing.py

    r1479 r1489  
    2828## e.g. # python ../drawing.py -f ~/etudes/domains/SIRTA/geo_em.d01.nc,/home/lluis/etudes/domains/SIRTA/geo_em.d02.nc -o draw_topo_geogrid_boxes -S '0.,1500.:None:WRF!domain!centered!at!SIRTA:png:cyl,i:d01$_{15k}$,d02$_{3k}$:0|10:True'
    2929## e.g. # drawing.py -f ~/etudes/domains/MEDCORDEX/geo_em.d01.nc -o draw_2D_shad_cont -S 'height,landmask:Time|0:Time|0:XLONG_M:XLAT_M:terrain:fixc,k:None:0.,3000.:0,1,10:MEDCORDEX height & landmask:pdf:False:lcc,i' -v HGT_M,LANDMASK
    30 ## e.g. # $ drawing.py -f WRF/current/hurs_wrfout_tturb_xmean_last.nc,WRF/micro1/hurs_wrfout_tturb_xmean_last.nc,WRF/micro2/hurs_wrfout_tturb_xmean_last.nc,WRF_LMDZ/AR40/hurs_wrfout_tturb_xmean_last.nc,WRF_LMDZ/NPv31/hurs_wrfout_tturb_xmean_last.nc,LMDZ/AR40/hurs_reproj-histins_tturb_xmean_last.nc,LMDZ/NPv31/hurs_reproj-histins_tturb_xmean_last.nc -o draw_lines -S 'lat:x:lat ($degrees\ North$):auto:wcurr,wmp1,wmp2,wlmdza,wlmdzb,lmdza,lmdzb:hurs:all model-experiments meridional hurs$_{[tturb\ xmean\ last]}$:0|auto:None:-:,:2.:2.:all:Nlines_hurs_wrfout_tturb-xmean-last:png:True' -v hursturbmean
     30## e.g. # $ drawing.py -f WRF/current/hurs_wrfout_tturb_xmean_last.nc,WRF/micro1/hurs_wrfout_tturb_xmean_last.nc,WRF/micro2/hurs_wrfout_tturb_xmean_last.nc,WRF_LMDZ/AR40/hurs_wrfout_tturb_xmean_last.nc,WRF_LMDZ/NPv31/hurs_wrfout_tturb_xmean_last.nc,LMDZ/AR40/hurs_reproj-histins_tturb_xmean_last.nc,LMDZ/NPv31/hurs_reproj-histins_tturb_xmean_last.nc -o draw_lines -S 'lat:x:lat ($degrees\ North$):auto:auto:wcurr,wmp1,wmp2,wlmdza,wlmdzb,lmdza,lmdzb:hurs:all model-experiments meridional hurs$_{[tturb\ xmean\ last]}$:0|auto:None:-:,:2.:2.:all:Nlines_hurs_wrfout_tturb-xmean-last:png:True' -v hursturbmean
    3131## e.g. # drawing.py -o draw_lines_time -f wrfout_d01_2001-11-11_00:00:00_west_east_B20-E20-I1_south_north_B20-E20-I1.nc,wrfout_d01_2001-11-11_00:00:00_west_east_B25-E25-I1_south_north_B25-E25-I1.nc,wrfout_d01_2001-11-11_00:00:00_west_east_B35-E35-I1_south_north_B35-E35-I1.nc -S 'WRFtime;y;time ([DD]${[HH]}$);auto;we=20$\times$sn=20,we=25$\times$sn=25,we=35$\times$sn=35;tas;tas|evolution|at|3|different|grid|points;None;time|hours!since!1949-12-01_00:00:00|exct,3,h|%d$^{%H}$;0|12;pdf;-;r,g,b;.;2.;2.;all;-1;True' -v T2
    3232## e.g. # drawing.py -o draw_Neighbourghood_evol -S 'vas:Time|-1|WRFtime,south_north|44|XLAT,west_east|88|XLONG:south_north,west_east:5:auto:time|($[DD]^{[HH]}$),time|($[DD]^{[HH]}$):exct,1,h|exct,3,h:$%d^{%H}$,$%d^{%H}$:5|pts|neighbourghood|temporal|evolution|on|2001|Nov.|at|x=88,|y=44:0.0,20.:rainbow,auto,auto:auto:png:vas_Neigh_evol:True' -f ~/PY/wrfout_d01_2001-11-11_00:00:00 -v V10
     
    23552355          [Ndy]: Number of ticks at the y-axis ('auto' for 5)
    23562356          [ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)
    2357         [leglabels]: ',' separated list of names for the legend ('None', no legend '!' for spaces)
     2357        [leglabels]: ',' separated list of names for the legend ('None', no legend '!' for spaces, '*' for no label)
    23582358        [vartit]: name of the variable in the graph
    23592359        [title]: title of the plot ('|' for spaces)
     
    24392439
    24402440# Multiple variables?
    2441     if varname0.find(',') != -1:
    2442         varname = varname0.split(',')
    2443     else:
    2444         varname = [varname0]
     2441    if varnames.find(',') != -1:
     2442        varname = varnames.split(',')
     2443    else:
     2444        varname = [varnames]
    24452445
    24462446# Multiple lines types?
     
    25252525    timvals0 = timvalues
    25262526
    2527     print '  ' + fname
    25282527    ifn = 0
    25292528    mintval = 1.e20
  • trunk/tools/drawing_tools.py

    r1479 r1489  
    62806280      yaxv= list with the y-axis paramteres [style, format, number and orientation]
    62816281      dtit= title for the common dimension
    6282       linesn= names for the legend (None, no legend)
     6282      linesn= names for the legend (None, no legend, '!' for spaces, '*' for no label)
    62836283      vtit= title for the vaxis
    62846284      vunit= units of the vaxis
     
    63816381    if vaxis == 'x':
    63826382        for il in range(Ntraj):
    6383             plt.plot(varvv[il], vardv[il], linekinds[il], marker=pointkinds[il],     \
    6384               label=linesn[il], color=colvalues[il], linewidth=lwidths[il],          \
    6385               markersize=psizes[il], markevery=ptf)
     6383            if linesn[il] != '*':
     6384                plt.plot(varvv[il], vardv[il], linekinds[il], marker=pointkinds[il], \
     6385                  label=gen.latex_text(linesn[il].replace('!',' ')),                 \
     6386                  color=colvalues[il], linewidth=lwidths[il], markersize=psizes[il], \
     6387                  markevery=ptf)
     6388            else:
     6389                plt.plot(varvv[il], vardv[il], linekinds[il], marker=pointkinds[il], \
     6390                  color=colvalues[il], linewidth=lwidths[il], markersize=psizes[il], \
     6391                  markevery=ptf)
    63866392
    63876393            minvv = np.min(varvv[il])
     
    63956401            if maxdv > xtrmdv[1]: xtrmdv[1] = maxdv
    63966402
    6397         plt.xlabel(vtit + ' (' + vunit + ')')
     6403        plt.xlabel(gen.latext_text(vtit) + ' (' + gen.latex_text(vunit) + ')')
    63986404        plt.ylabel(dtit)
    63996405#        plt.xlim(np.min(varTvv),np.max(varTvv))
     
    64166422        for il in range(Ntraj):
    64176423            Nvals = len(vardv[il])
    6418             plt.plot(vardv[il], varvv[il], linekinds[il], marker=pointkinds[il],     \
    6419               label=linesn[il], color=colvalues[il], linewidth=lwidths[il],          \
    6420               markersize=psizes[il], markevery=ptf)
     6424            if linesn[il] != '*':
     6425                plt.plot(vardv[il], varvv[il], linekinds[il], marker=pointkinds[il], \
     6426                  label=gen.latex_text(linesn[il]), color=colvalues[il],             \
     6427                  linewidth=lwidths[il], markersize=psizes[il], markevery=ptf)
     6428            else:
     6429                plt.plot(vardv[il], varvv[il], linekinds[il], marker=pointkinds[il], \
     6430                  color=colvalues[il], linewidth=lwidths[il], markersize=psizes[il], \
     6431                  markevery=ptf)
    64216432
    64226433            minvv = np.min(varvv[il])
     
    64316442
    64326443        plt.xlabel(dtit)
    6433         plt.ylabel(vtit + ' (' + vunit + ')')
     6444        plt.ylabel(gen.latex_text(vtit) + ' (' + vunit + ')')
    64346445
    64356446        if vmin == 'auto':
Note: See TracChangeset for help on using the changeset viewer.