Changeset 1441 in lmdz_wrf for trunk/tools
- Timestamp:
- Feb 8, 2017, 10:02:54 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing_tools.py
r1438 r1441 8059 8059 'anglespeedfreq';[Nang];[Nspeed];[maxspeed];[cbar];[maxfreq] grid of frequencies of each angle and speed 8060 8060 following a given discretization 8061 'linepoint';[kind];[val1];[...;[valN]]: consecutive (time, height, level, ...) line-point angle and speed valu les8061 'linepoint';[kind];[val1];[...;[valN]]: consecutive (time, height, level, ...) line-point angle and speed values 8062 8062 'multicol';[extravarn];[line];[marker];[colbar] 8063 8063 'multicoltime';[extravarn];[line];[marker];[colbar];[timekind];[timefmt];[timelabel] … … 8222 8222 labcol = my_cmap(norm(ev[ie])) 8223 8223 plt.plot([ang[ie], ang[ie+1]], [speed[ie], speed[ie+1]], ltyp, marker=lmrk, color=labcol) 8224 8225 ie = dime-1 8226 labcol = my_cmap(norm(ev[ie])) 8227 lcolS = gen.coldec_hex(labcol[0:3]) 8228 plt.plot(ang[ie], speed[ie], ltyp, marker=lmrk, color=lcolS) 8229 8224 8230 # FROM: http://stackoverflow.com/questions/8342549/matplotlib-add-colorbar-to-a-sequence-of-line-plots 8225 8231 # For matplotlib v1.3 or greater the code becomes: … … 8228 8234 sm._A = [] 8229 8235 cbar = plt.colorbar(sm) 8230 cbar.set_label(eunit) 8236 cbar.set_label(lpvals[2] + ' (' + units_lunits(eunit) + ')') 8237 8231 8238 elif lkind == 'multicoltime': 8232 8239 ltyp = gen.auto_val(lpvals[3],'-') … … 8248 8255 lcolS = gen.coldec_hex(labcol[0:3]) 8249 8256 plt.plot([ang[ie], ang[ie+1]], [speed[ie], speed[ie+1]], ltyp, marker=lmrk, color=lcolS) 8257 8258 ie = dime-1 8259 labcol = my_cmap(norm(ev[ie])) 8260 lcolS = gen.coldec_hex(labcol[0:3]) 8261 plt.plot(ang[ie], speed[ie], ltyp, marker=lmrk, color=lcolS) 8250 8262 8251 8263 # FROM: http://stackoverflow.com/questions/8342549/matplotlib-add-colorbar-to-a-sequence-of-line-plots … … 8283 8295 plt.scatter(ang, speed, c=ev, cmap=colbar, marker=lmrk) 8284 8296 cbar = plt.colorbar() 8285 cbar.set_label( eunit)8297 cbar.set_label(lpvals[2] + ' (' + units_lunits(eunit) + ')') 8286 8298 elif lkind == 'multicoltime': 8287 8299 lmrk = gen.auto_val(lpvals[3],'x')
Note: See TracChangeset
for help on using the changeset viewer.