Changeset 1550 in lmdz_wrf
- Timestamp:
- Apr 28, 2017, 9:49:50 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/documentation/plotting/bar_line_time.html
r1549 r1550 12 12 <DIV CLASS="valimg"> 13 13 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> 15 15 </DIV> 16 16 <DIV CLASS="valhelp"> -
trunk/tools/documentation/plotting/gallery.html
r1549 r1550 20 20 <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> 21 21 <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> 23 23 <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> 24 24 <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 63 63 # draw_bar: Function to plot a bar char figure with multiple sources 64 64 # 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 65 66 # 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-axis67 67 # draw_barbs: Function to plot wind barbs 68 68 # draw_basins: Function to plot river basins with their discharge vector and basins id (from 'routing.nc') -
trunk/tools/drawing_tools.py
r1549 r1550 9265 9265 9266 9266 if valaxis == 'x': 9267 if labels is not None :9267 if labels is not None and labels[iv] != 'None': 9268 9268 plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv], \ 9269 9269 label=gen.latex_text(labels[iv])) … … 9271 9271 plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv]) 9272 9272 else: 9273 if labels is not None :9273 if labels is not None and labels[iv] != 'None': 9274 9274 plt.bar(xvls+xrels, yvalues[iv], width=width, color=colvs[iv], \ 9275 9275 label=gen.latex_text(labels[iv])) … … 9280 9280 plt.xticks(dimyt, dimyl, rotation=yaxv[3]) 9281 9281 plt.yticks(dimxt, dimxl, rotation=xaxv[3]) 9282 plt.xlabel( ylabel+ ' (' + units_lunits(dimyu) + ')')9282 plt.xlabel(gen.latex_text(ylabel) + ' (' + units_lunits(dimyu) + ')') 9283 9283 if dimxu is not None: 9284 plt.ylabel( xlabel+ ' (' + units_lunits(dimxu) + ')')9284 plt.ylabel(gen.latex_text(xlabel) + ' (' + units_lunits(dimxu) + ')') 9285 9285 else: 9286 plt.ylabel( xlabel)9286 plt.ylabel(gen.latex_text(xlabel)) 9287 9287 else: 9288 9288 plt.xticks(dimxt, list(dimxl), rotation=xaxv[3]) 9289 9289 plt.yticks(dimyt, list(dimyl), rotation=yaxv[3]) 9290 9290 if dimxu is not None: 9291 plt.xlabel( xlabel+ ' (' + units_lunits(dimxu) + ')')9291 plt.xlabel(gen.latex_text(xlabel) + ' (' + units_lunits(dimxu) + ')') 9292 9292 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) + ')') 9295 9295 9296 9296 if labels is not None: … … 9395 9395 9396 9396 if valaxis == 'x': 9397 if labels is not None :9397 if labels is not None and labels[iv] != 'None': 9398 9398 plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv], \ 9399 9399 label=gen.latex_text(labels[iv])) … … 9401 9401 plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv]) 9402 9402 else: 9403 if labels is not None :9403 if labels is not None and labels[iv] != 'None': 9404 9404 plt.bar(xvls+xrels, yvalues[iv], width=width, color=colvs[iv], \ 9405 9405 label=gen.latex_text(labels[iv])) … … 9410 9410 plt.xticks(dimyt, dimyl, rotation=yaxv[3]) 9411 9411 plt.yticks(tpos, tlabs, rotation=0) 9412 plt.xlabel( ylabel+ ' (' + units_lunits(dimyu) + ')')9412 plt.xlabel(gen.latex_text(ylabel) + ' (' + units_lunits(dimyu) + ')') 9413 9413 plt.ylabel(gen.latex_text(xlabel)) 9414 9414 plt.xlim(dyn, dyx) … … 9417 9417 plt.yticks(dimyt, list(dimyl), rotation=yaxv[3]) 9418 9418 plt.xlabel(gen.latex_text(xlabel)) 9419 plt.ylabel( ylabel+ ' (' + units_lunits(dimyu) + ')')9419 plt.ylabel(gen.latex_text(ylabel) + ' (' + units_lunits(dimyu) + ')') 9420 9420 plt.ylim(dyn, dyx) 9421 9421 … … 9588 9588 9589 9589 if valaxis == 'x': 9590 if blabels is not None :9590 if blabels is not None and blabels[iv] != 'None': 9591 9591 plt.barh(xvls+xrels, byvalues[iv], height=width,color=bcolvs[iv],\ 9592 9592 label=gen.latex_text(blabels[iv])) … … 9594 9594 plt.barh(xvls+xrels, byvalues[iv], height=width, color=bcolvs[iv]) 9595 9595 else: 9596 if blabels is not None :9596 if blabels is not None and blabels[iv] != 'None': 9597 9597 plt.bar(xvls+xrels, byvalues[iv], width=width, color=bcolvs[iv], \ 9598 9598 label=gen.latex_text(blabels[iv])) … … 9603 9603 for iv in range(lNvalues): 9604 9604 if valaxis == 'x': 9605 if llabels is not None :9605 if llabels is not None and llabels[iv] != 'None': 9606 9606 plt.plot(lyvalues[iv], lxvalues[iv], lins[iv], marker=pts[iv], \ 9607 9607 color=cols[iv], label=gen.latex_text(llabels[iv]), \ … … 9612 9612 markevery=ptf) 9613 9613 else: 9614 if llabels is not None: 9615 print fname + ': Lluis label:', llabels[iv] 9614 if llabels is not None and llabels[iv] != 'None': 9616 9615 plt.plot(lxvalues[iv], lyvalues[iv], lins[iv], marker=pts[iv], \ 9617 9616 color=cols[iv], label=gen.latex_text(llabels[iv]), \ … … 9625 9624 plt.xticks(dimyt, dimyl, rotation=yaxv[3]) 9626 9625 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) + ')') 9628 9627 if dimxu is not None: 9629 plt.ylabel( xlabel+ ' (' + units_lunits(dimxu) + ')')9628 plt.ylabel(gen.latex_text(xlabel) + ' (' + units_lunits(dimxu) + ')') 9630 9629 else: 9631 plt.ylabel( xlabel)9630 plt.ylabel(gen.latex_text(xlabel)) 9632 9631 plt.xlim(dyn, dyx) 9633 9632 else: … … 9635 9634 plt.yticks(dimyt, list(dimyl), rotation=yaxv[3]) 9636 9635 if dimxu is not None: 9637 plt.xlabel( xlabel+ ' (' + units_lunits(dimxu) + ')')9636 plt.xlabel(gen.latex_text(xlabel) + ' (' + units_lunits(dimxu) + ')') 9638 9637 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) + ')') 9641 9640 plt.ylim(dyn, dyx) 9642 9641
Note: See TracChangeset
for help on using the changeset viewer.