Changeset 952 in lmdz_wrf for trunk/tools
- Timestamp:
- Jun 25, 2016, 12:54:40 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r948 r952 1780 1780 draw_lines_time(ncfilens, values, varname): 1781 1781 ncfilens= [filen] ',' separated list of netCDF files 1782 values= [dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];[ timevals];[locleg];1783 [ graphk];[collines];[points];[linewidths];[pointsizes];[pointfreq];[period]1782 values= [dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];[rangevals];[timevals]; 1783 [legvals];[graphk];[collines];[points];[linewidths];[pointsizes];[pointfreq];[period] 1784 1784 [dimvname]: ',' list of names of the variables with he values of the common dimension 1785 1785 [valuesaxis]: which axis will be used for the values ('x', or 'y') … … 1788 1788 [vartit]: name of the variable in the graph 1789 1789 [title]: title of the plot ('|' for spaces) 1790 [rangevals]: Range of the axis with the values ('None' for 'auto','auto') 1791 [vmin],[vmax]: minimum and maximum values where [vmNN] can also be: 1792 'auto': the computed minimumm or maximum of the values 1790 1793 [timevals]: [timen]|[units]|[kind]|[tfmt] time labels characteristics 1791 1794 [timen]; name of the time variable … … 1831 1834 1832 1835 expectargs = '[dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];' 1833 expectargs = expectargs + '[timevals];[locleg];[graphk];[lines];[collines];[points];' 1834 expectargs = expectargs + '[linewidths];[pointsizes];[pointfreq];[period]' 1836 expectargs = expectargs + '[rangevals];[timevals];[legvals];[graphk];[lines];' 1837 expectargs = expectargs + '[collines];[points];[linewidths];[pointsizes];' 1838 expectargs - expectargs + '[pointfreq];[period]' 1835 1839 drw.check_arguments(fname,values,expectargs,';') 1836 1840 … … 1842 1846 vartit = values.split(';')[4] 1843 1847 title = values.split(';')[5].replace('|',' ') 1844 timevals = values.split(';')[6] 1845 legvalues = values.split(';')[7] 1846 graphk = values.split(';')[8] 1847 lines0 = values.split(';')[9] 1848 collines0 = values.split(';')[10] 1849 points0 = values.split(';')[11] 1850 linewidths0 = values.split(';')[12] 1851 pointsizes0 = values.split(';')[13] 1852 pointfreq0 = values.split(';')[14] 1853 period = values.split(';')[15] 1848 rangevals = values.split(';')[6] 1849 timevals = values.split(';')[7] 1850 legvalues = values.split(';')[8] 1851 graphk = values.split(';')[9] 1852 lines0 = values.split(';')[10] 1853 collines0 = values.split(';')[11] 1854 points0 = values.split(';')[12] 1855 linewidths0 = values.split(';')[13] 1856 pointsizes0 = values.split(';')[14] 1857 pointfreq0 = values.split(';')[15] 1858 period = values.split(';')[16] 1854 1859 1855 1860 Nfiles = len(ncfiles) … … 1928 1933 timekind = timevals.split('|')[2] 1929 1934 timefmt = timevals.split('|')[3] 1935 1936 if rangevals = 'None': 1937 valmin = 'auto' 1938 valmax = 'auto' 1939 else: 1940 valmin = rangevals.split(',')[0] 1941 valmax = rangevals.split(',')[0] 1942 if valmin != 'auto': valmin = np.float(valmin) 1943 if valmax != 'auto': valmax = np.float(valmax) 1930 1944 1931 1945 locleg = int(legvalues.split('|')[0]) … … 2101 2115 2102 2116 drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit, legvals, vartit, \ 2103 varunits, timepos, timelabels, title, locleg, legfontsize, graphk, lines,\2104 collines, points, linewidths, pointsizes, pointfreq)2117 varunits, timepos, timelabels, title, locleg, legfontsize, graphk, valmin, \ 2118 valmax, lines, collines, points, linewidths, pointsizes, pointfreq) 2105 2119 2106 2120 return -
trunk/tools/drawing_tools.py
r951 r952 5731 5731 5732 5732 def plot_lines_time(vardv, varvv, vaxis, dtit, linesn0, vtit, vunit, tpos, tlabs, \ 5733 gtit, gloc, gsize, kfig, lsl, coll, ptl, lwidth, psize, ptf):5733 gtit, vmin, vmax, gloc, gsize, kfig, lsl, coll, ptl, lwidth, psize, ptf): 5734 5734 """ Function to plot a collection of lines with a time axis 5735 5735 vardv= list of set of dimension values … … 5743 5743 tlabs= labels of the time ticks 5744 5744 gtit= main title 5745 vmin= minimum value for the axis-value 'auto' for use the extreme 5746 vmax= maximum value for the axis-value 'auto' for use the extreme 5745 5747 gloc= location of the legend (0, autmoatic) 5746 5748 1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right', … … 5817 5819 # plt.xlim(np.min(varTvv),np.max(varTvv)) 5818 5820 # plt.ylim(np.min(varTdv),np.max(varTdv)) 5819 plt.xlim(xtrmvv[0],xtrmvv[1]) 5821 5822 if vmin == 'auto': 5823 xmin = xtrmvv[0] 5824 else: 5825 xmin = vmin 5826 if vmax == 'auto': 5827 xmax = xtrmvv[1] 5828 else: 5829 xmax = vmax 5830 5831 plt.xlim(xmin,xmax) 5820 5832 plt.ylim(xtrmdv[0],xtrmdv[1]) 5821 5833 … … 5852 5864 plt.ylabel(vtit + ' (' + vunit + ')') 5853 5865 5866 if vmin == 'auto': 5867 ymin = xtrmvv[0] 5868 else: 5869 ymin = vmin 5870 if vmax == 'auto': 5871 ymax = xtrmvv[1] 5872 else: 5873 ymax = vmax 5874 5854 5875 plt.xlim(xtrmdv[0],xtrmdv[1]) 5855 plt.ylim( xtrmvv[0],xtrmvv[1])5876 plt.ylim(ymin,ymax) 5856 5877 5857 5878 # plt.xlim(np.min(varTdv),np.max(varTdv))
Note: See TracChangeset
for help on using the changeset viewer.