Changeset 991 for trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
- Timestamp:
- Jun 14, 2013, 10:10:43 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
r990 r991 248 248 return what_I_plot 249 249 250 # a function to change labels with modulo 251 # --------------------------------------- 252 def labelmodulo(ax,mod): 253 mpl.draw() 254 strtab = [] 255 for tick in ax.get_xaxis().get_ticklabels(): 256 num = float(tick.get_text()) 257 strtab.append(num % mod) 258 ax.get_xaxis().set_ticklabels(strtab) 259 return ax 260 250 261 # a function to output an ascii file 251 262 # ---------------------------------- … … 265 276 else: 266 277 print "!! WARNING !! Not printing the file, 2D fields not supported yet." 267 # mydata = np.transpose([absc,np.transpose(field)]) #tab268 # for line in mydata:269 # zeline = str(line)270 # zeline = zeline.replace('[','')271 # zeline = zeline.replace(']','')272 # myfile.write(zeline + '\n')273 278 return 274 279 … … 333 338 colorb="jet",\ 334 339 units="",\ 340 modx=None,\ 335 341 title=""): 336 342 ## what could be defined by the user … … 352 358 self.units = units 353 359 self.colorb = colorb 360 self.modx = modx 354 361 ## other useful arguments 355 362 ## ... not used here in ppplot but need to be attached to plot object … … 505 512 else: 506 513 print "!! WARNING. in logx mode, ticks are set automatically." 514 ## specific modulo labels 515 if self.modx is not None: 516 ax = labelmodulo(ax,self.modx) 507 517 508 518 ################################
Note: See TracChangeset
for help on using the changeset viewer.