Changeset 1550 in lmdz_wrf


Ignore:
Timestamp:
Apr 28, 2017, 9:49:50 PM (8 years ago)
Author:
lfita
Message:

Changing example of `bar_line_time'
Adding None label in plot_bar', plot_bar_line' and some latex_text in axis labels

Location:
trunk/tools
Files:
4 edited

Legend:

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

    r1549 r1550  
    1212    <DIV CLASS="valimg">
    1313      Function to plot a bar char and lines plot figure with multiple sources and time-axis
    14       <IMG WIDTH="100%" SRC="figs/bar_time_rain_CRU-NCEP_DJFmean_norm.png"></IMG>
     14      <IMG WIDTH="100%" SRC="figs/bar_time_rain-evap_DJFmean_norm.png"></IMG>
    1515    </DIV>
    1616    <DIV CLASS="valhelp">
  • trunk/tools/documentation/plotting/gallery.html

    r1549 r1550  
    2020      <A HREF="draw_bar.html"><IMG SRC="figs/bar_rain_CRU-NCEP_norm.png" ALT="bar char plot" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
    2121      <A HREF="bar_line.html"><IMG SRC="figs/bar-line_rain_CRU-NCEP_norm.png" ALT="bar char and lines plot" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
    22       <A HREF="bar_line_time.html"><IMG SRC="figs/bar_time_rain_CRU-NCEP_DJFmean_norm.png" ALT="bar char and lines plot with time" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
     22      <A HREF="bar_line_time.html"><IMG SRC="figs/bar_time_rain-evap_DJFmean_norm.png" ALT="bar char and lines plot with time" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
    2323      <A HREF="bar_time.html"><IMG SRC="figs/bar_time_rain_CRU-NCEP_DJFmean_norm.png" ALT="bar char plot time" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
    2424      <A HREF="barbs.html"><IMG SRC="figs/wind_barbs_2001111003_wss.png" ALT="wind-barbs" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
  • trunk/tools/drawing.py

    r1549 r1550  
    6363# draw_bar: Function to plot a bar char figure with multiple sources
    6464# draw_bar_line: Function to plot a bar char and line figure with multiple sources
     65# draw_bar_line_time: Function to plot a bar char and line figure with multiple sources with a time-axis
    6566# draw_bar_time: Function to plot a bar char figure with multiple sources and time axis
    66 # draw_bar_line_time: Function to plot a bar char and line figure with multiple sources with a time-axis
    6767# draw_barbs: Function to plot wind barbs
    6868# draw_basins: Function to plot river basins with their discharge vector and basins id (from 'routing.nc')
  • trunk/tools/drawing_tools.py

    r1549 r1550  
    92659265
    92669266        if valaxis == 'x':
    9267             if labels is not None:
     9267            if labels is not None and labels[iv] != 'None':
    92689268                plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv],     \
    92699269                  label=gen.latex_text(labels[iv]))
     
    92719271                plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv])
    92729272        else:
    9273             if labels is not None:
     9273            if labels is not None and labels[iv] != 'None':
    92749274                plt.bar(xvls+xrels, yvalues[iv], width=width, color=colvs[iv],       \
    92759275                  label=gen.latex_text(labels[iv]))
     
    92809280        plt.xticks(dimyt, dimyl, rotation=yaxv[3])
    92819281        plt.yticks(dimxt, dimxl, rotation=xaxv[3])
    9282         plt.xlabel(ylabel + ' (' + units_lunits(dimyu) + ')')
     9282        plt.xlabel(gen.latex_text(ylabel) + ' (' + units_lunits(dimyu) + ')')
    92839283        if dimxu is not None:
    9284             plt.ylabel(xlabel + ' (' + units_lunits(dimxu) + ')')
     9284            plt.ylabel(gen.latex_text(xlabel) + ' (' + units_lunits(dimxu) + ')')
    92859285        else:
    9286             plt.ylabel(xlabel)
     9286            plt.ylabel(gen.latex_text(xlabel))
    92879287    else:
    92889288        plt.xticks(dimxt, list(dimxl), rotation=xaxv[3])
    92899289        plt.yticks(dimyt, list(dimyl), rotation=yaxv[3])
    92909290        if dimxu is not None:
    9291             plt.xlabel(xlabel + ' (' + units_lunits(dimxu) + ')')
     9291            plt.xlabel(gen.latex_text(xlabel) + ' (' + units_lunits(dimxu) + ')')
    92929292        else:
    9293             plt.xlabel(xlabel)
    9294         plt.ylabel(ylabel + ' (' + units_lunits(dimyu) + ')')
     9293            plt.xlabel(gen.latex_text(xlabel))
     9294        plt.ylabel(gen.latex_text(ylabel) + ' (' + units_lunits(dimyu) + ')')
    92959295
    92969296    if labels is not None:
     
    93959395
    93969396        if valaxis == 'x':
    9397             if labels is not None:
     9397            if labels is not None and labels[iv] != 'None':
    93989398                plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv],     \
    93999399                  label=gen.latex_text(labels[iv]))
     
    94019401                plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv])
    94029402        else:
    9403             if labels is not None:
     9403            if labels is not None and labels[iv] != 'None':
    94049404                plt.bar(xvls+xrels, yvalues[iv], width=width, color=colvs[iv],       \
    94059405                  label=gen.latex_text(labels[iv]))
     
    94109410        plt.xticks(dimyt, dimyl, rotation=yaxv[3])
    94119411        plt.yticks(tpos, tlabs, rotation=0)
    9412         plt.xlabel(ylabel + ' (' + units_lunits(dimyu) + ')')
     9412        plt.xlabel(gen.latex_text(ylabel) + ' (' + units_lunits(dimyu) + ')')
    94139413        plt.ylabel(gen.latex_text(xlabel))
    94149414        plt.xlim(dyn, dyx)
     
    94179417        plt.yticks(dimyt, list(dimyl), rotation=yaxv[3])
    94189418        plt.xlabel(gen.latex_text(xlabel))
    9419         plt.ylabel(ylabel + ' (' + units_lunits(dimyu) + ')')
     9419        plt.ylabel(gen.latex_text(ylabel) + ' (' + units_lunits(dimyu) + ')')
    94209420        plt.ylim(dyn, dyx)
    94219421
     
    95889588
    95899589            if valaxis == 'x':
    9590                 if blabels is not None:
     9590                if blabels is not None and blabels[iv] != 'None':
    95919591                    plt.barh(xvls+xrels, byvalues[iv], height=width,color=bcolvs[iv],\
    95929592                      label=gen.latex_text(blabels[iv]))
     
    95949594                    plt.barh(xvls+xrels, byvalues[iv], height=width, color=bcolvs[iv])
    95959595            else:
    9596                 if blabels is not None:
     9596                if blabels is not None and blabels[iv] != 'None':
    95979597                    plt.bar(xvls+xrels, byvalues[iv], width=width, color=bcolvs[iv], \
    95989598                      label=gen.latex_text(blabels[iv]))
     
    96039603        for iv in range(lNvalues):
    96049604            if valaxis == 'x':
    9605                 if llabels is not None:
     9605                if llabels is not None and llabels[iv] != 'None':
    96069606                    plt.plot(lyvalues[iv], lxvalues[iv], lins[iv], marker=pts[iv],   \
    96079607                      color=cols[iv], label=gen.latex_text(llabels[iv]),             \
     
    96129612                      markevery=ptf)
    96139613            else:
    9614                 if llabels is not None:
    9615                     print fname + ': Lluis label:', llabels[iv]
     9614                if llabels is not None and llabels[iv] != 'None':
    96169615                    plt.plot(lxvalues[iv], lyvalues[iv], lins[iv], marker=pts[iv],   \
    96179616                      color=cols[iv], label=gen.latex_text(llabels[iv]),             \
     
    96259624        plt.xticks(dimyt, dimyl, rotation=yaxv[3])
    96269625        plt.yticks(dimxt, list(dimxl), rotation=xaxv[3])
    9627         plt.xlabel(ylabel + ' (' + units_lunits(dimyu) + ')')
     9626        plt.xlabel(gen.latex_text(ylabel) + ' (' + units_lunits(dimyu) + ')')
    96289627        if dimxu is not None:
    9629             plt.ylabel(xlabel + ' (' + units_lunits(dimxu) + ')')
     9628            plt.ylabel(gen.latex_text(xlabel) + ' (' + units_lunits(dimxu) + ')')
    96309629        else:
    9631             plt.ylabel(xlabel)
     9630            plt.ylabel(gen.latex_text(xlabel))
    96329631        plt.xlim(dyn, dyx)
    96339632    else:
     
    96359634        plt.yticks(dimyt, list(dimyl), rotation=yaxv[3])
    96369635        if dimxu is not None:
    9637             plt.xlabel(xlabel + ' (' + units_lunits(dimxu) + ')')
     9636            plt.xlabel(gen.latex_text(xlabel) + ' (' + units_lunits(dimxu) + ')')
    96389637        else:
    9639             plt.xlabel(xlabel)
    9640         plt.ylabel(ylabel + ' (' + units_lunits(dimyu) + ')')
     9638            plt.xlabel(gen.latex_text(xlabel))
     9639        plt.ylabel(gen.latex_text(ylabel) + ' (' + units_lunits(dimyu) + ')')
    96419640        plt.ylim(dyn, dyx)
    96429641
Note: See TracChangeset for help on using the changeset viewer.