Changeset 2448


Ignore:
Timestamp:
03/26/15 11:30:01 (9 years ago)
Author:
labetoulle
Message:

plot_bilan_jobs.py : make title more explicit + add max value if graph is truncated

Location:
TOOLS/ConsoGENCMIP6/bin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/ConsoGENCMIP6/bin/plot_bilan.py

    r2445 r2448  
    279279  ax_conso.set_yticks(yticks) 
    280280 
    281   ax_theo.spines["right"].set_color("indianred") 
    282   ax_theo.tick_params(colors="indianred") 
    283   ax_theo.yaxis.label.set_color("indianred") 
     281  ax_theo.spines["right"].set_color("firebrick") 
     282  ax_theo.tick_params(colors="firebrick") 
     283  ax_theo.yaxis.label.set_color("firebrick") 
    284284 
    285285  ax_conso.axhline(y=conso_per_day, color="blue", alpha=0.5, 
  • TOOLS/ConsoGENCMIP6/bin/plot_bilan_jobs.py

    r2437 r2448  
    219219               linewidth=1, markersize=8, 
    220220               solid_capstyle="round", solid_joinstyle="round", 
    221                label="conso théorique (%)") 
     221               label="conso\nthéorique (%)") 
    222222  ax_theo.plot(xcoord, real_uses, line_style, color="forestgreen", 
    223223               linewidth=1, markersize=8, 
    224224               solid_capstyle="round", solid_joinstyle="round", 
    225                label="conso réelle (%)") 
     225               label="conso\nréelle (%)") 
    226226 
    227227  line_width = 0. 
     
    234234  ax_jobs.bar(xcoord, pen_mean, bottom=run_mean, width=width, align="center", 
    235235              # yerr=pen_std/2, ecolor="darkred", 
    236               color="indianred", linewidth=line_width, antialiased=True, 
     236              color="firebrick", linewidth=line_width, antialiased=True, 
    237237              label="jobs pending") 
    238238 
     
    245245  # ------------------- 
    246246  # 1) Range 
    247   # if args.max: 
    248   #   ymax = gencmip6.alloc 
    249   # else: 
    250   #   ymax = np.nanmax(consos) + np.nanmax(consos)*.1 
     247  conso_max = np.nanmax(consos) 
     248  if args.max: 
     249    ymax = conso_max  # + conso_max*.1 
     250  else: 
     251    ymax = 2. * conso_per_day 
     252 
     253  if conso_max > ymax: 
     254    ax_conso.annotate( 
     255      "{:.2e} heures".format(conso_max), 
     256      ha="left", 
     257      va="top", 
     258      fontsize="xx-small", 
     259      bbox=dict(boxstyle="round", fc="w", ec="0.5", color="gray",), 
     260      xy=(np.nanargmax(consos)+1.2, ymax*0.9), 
     261      textcoords="axes fraction", 
     262      xytext=(0.01, 0.8), 
     263      arrowprops=dict( 
     264        arrowstyle="->", 
     265        shrinkA=0, 
     266        shrinkB=0, 
     267        color="gray", 
     268      ), 
     269    ) 
    251270 
    252271  xmin, xmax = xcoord[0]-1, xcoord[-1]+1 
    253272  ax_conso.set_xlim(xmin, xmax) 
    254   # ax_conso.set_ylim(0., ymax) 
     273  ax_conso.set_ylim(0., ymax) 
    255274  ax_theo.set_ylim(0., 100) 
    256275 
     
    283302    ax.axhline(y=y, color="blue", alpha=0.5, 
    284303               label="conso journaliÚre\nidéale ({})".format(label)) 
     304 
     305  ax_theo.spines["right"].set_color("firebrick") 
     306  ax_theo.tick_params(colors="firebrick") 
     307  ax_theo.yaxis.label.set_color("firebrick") 
    285308 
    286309  for x, d in zip(xcoord, dates): 
     
    458481  # ... Tweak figure ... 
    459482  # -------------------- 
    460   title = "Consommation {}\n({:%d/%m/%Y} - {:%d/%m/%Y})".format( 
    461     gencmip6.project.upper(), 
    462     gencmip6.date_init, 
    463     gencmip6.deadline 
    464   ) 
     483  title = "{} : Conso globale et suivi des jobs " \ 
     484          "(moyenne journaliÚre)\n({:%d/%m/%Y} - {:%d/%m/%Y})".format( 
     485            gencmip6.project.upper(), 
     486            gencmip6.date_init, 
     487            gencmip6.deadline 
     488          ) 
    465489 
    466490  plot_config(fig, ax_conso, ax_theo, xcoord, dates, title, conso_per_day) 
  • TOOLS/ConsoGENCMIP6/bin/plot_jobs.py

    r2440 r2448  
    197197  ax.bar(xcoord, pen_jobs, bottom=run_jobs, width=width, 
    198198         linewidth=line_width, align="center", 
    199          color="indianred", antialiased=True, 
     199         color="firebrick", antialiased=True, 
    200200         label="jobs pending") 
    201201 
Note: See TracChangeset for help on using the changeset viewer.