Changeset 620 in lmdz_wrf for trunk/tools/drawing_tools.py
- Timestamp:
- Aug 21, 2015, 3:26:11 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing_tools.py
r605 r620 5205 5205 5206 5206 def plot_lines_time(vardv, varvv, vaxis, dtit, linesn0, vtit, vunit, tpos, tlabs, \ 5207 gtit, gloc, kfig, coll ):5207 gtit, gloc, kfig, coll, ptl): 5208 5208 """ Function to plot a collection of lines with a time axis 5209 5209 vardv= list of set of dimension values … … 5223 5223 kfig= kind of figure 5224 5224 coll= ',' list of colors for the lines or None for automatic 5225 coll= ',' list of colors for the lines, None for automatic, single 5226 value all the same 5227 ptl= ',' list of type of points for the lines, None for automatic, single 5228 value all the same 5229 5225 5230 plot_lines([np.arange(10)], [np.sin(np.arange(10)*np.pi/2.5)], 'y', 'time (s)', \ 5226 5231 ['2.5'], 'sin', '-', 'sinus frequency dependency', 'pdf') … … 5234 5239 5235 5240 # Canging line kinds every 7 lines (end of standard colors) 5236 linekinds=['.-','x-','o-'] 5241 linekinds = [] 5242 if ptl is None: 5243 linekindsauto=['.-','x-','o-'] 5244 for ptype in range(4): 5245 for ip in range(7): 5246 linekinds.append(linekindsauto[ptype]) 5247 else: 5248 linekinds = ptl 5237 5249 5238 5250 Ntraj = len(vardv) … … 5256 5268 for il in range(Ntraj): 5257 5269 if coll is None: 5258 plt.plot(varvv[il], vardv[il], linekinds[ N7lines], label= linesn[il])5270 plt.plot(varvv[il], vardv[il], linekinds[il], label= linesn[il]) 5259 5271 else: 5260 plt.plot(varvv[il], vardv[il], linekinds[ N7lines], label= linesn[il],\5272 plt.plot(varvv[il], vardv[il], linekinds[il], label= linesn[il],\ 5261 5273 color=coll[il]) 5262 5274 … … 5270 5282 if mindv < xtrmdv[0]: xtrmdv[0] = mindv 5271 5283 if maxdv > xtrmdv[1]: xtrmdv[1] = maxdv 5272 5273 if il == 6: N7lines = N7lines + 15274 5284 5275 5285 plt.xlabel(vtit + ' (' + vunit + ')') … … 5284 5294 for il in range(Ntraj): 5285 5295 if coll is None: 5286 plt.plot(vardv[il], varvv[il], linekinds[ N7lines], label= linesn[il])5296 plt.plot(vardv[il], varvv[il], linekinds[il], label= linesn[il]) 5287 5297 else: 5288 plt.plot(vardv[il], varvv[il], linekinds[ N7lines], label= linesn[il],\5298 plt.plot(vardv[il], varvv[il], linekinds[il], label= linesn[il],\ 5289 5299 color=coll[il]) 5290 5300 … … 5298 5308 if mindv < xtrmdv[0]: xtrmdv[0] = mindv 5299 5309 if maxdv > xtrmdv[1]: xtrmdv[1] = maxdv 5300 5301 if il == 6: N7lines = N7lines + 15302 5310 5303 5311 plt.xlabel(dtit)
Note: See TracChangeset
for help on using the changeset viewer.