Changeset 1027 for trunk/UTIL/PYTHON
- Timestamp:
- Sep 2, 2013, 4:21:01 PM (11 years ago)
- Location:
- trunk/UTIL/PYTHON/planetoplot_v2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
r1007 r1027 262 262 strtab = [] 263 263 for tick in ax.get_xaxis().get_ticklabels(): 264 num = float(tick.get_text()) 265 strtab.append(num % mod) 264 onetick = tick.get_text() 265 if len(onetick) > 0: 266 num = float(onetick) 267 strtab.append(num % mod) 266 268 ax.get_xaxis().set_ticklabels(strtab) 267 269 return ax … … 490 492 else: 491 493 mpl.plot(x,y,marker=self.marker,label=self.label) 494 # AXES 495 ax = mpl.gca() 492 496 # make log axes and/or invert ordinate 493 497 # ... this must be after plot so that axis bounds are well-defined … … 495 499 if self.logx: mpl.xscale("log") # not mpl.semilogx() because excludes log on y 496 500 if self.logy: mpl.yscale("log") # not mpl.semilogy() because excludes log on x 497 if self.invert: ax = mpl.gca() ; ax.set_ylim(ax.get_ylim()[::-1]) 501 if self.invert: ax.set_ylim(ax.get_ylim()[::-1]) 502 if self.xmin is not None and self.xmax is not None: 503 if self.xmin > self.xmax: 504 ax.set_xlim(ax.get_xlim()[::-1]) 505 self.xmin,self.xmax = self.xmax,self.xmin 498 506 # add a label for line(s) 499 507 if self.label is not None: 500 508 if self.label != "": 501 509 mpl.legend(loc="best",fancybox=True) 502 # AXES503 ax = mpl.gca()504 510 # format labels 505 511 if self.swap: ax.xaxis.set_major_formatter(FormatStrFormatter(self.fmt)) … … 670 676 if self.logy: mpl.semilogy() 671 677 if self.invert: ax.set_ylim(ax.get_ylim()[::-1]) 678 if self.xmin is not None and self.xmax is not None: 679 if self.xmin > self.xmax: 680 ax.set_xlim(ax.get_xlim()[::-1]) 681 self.xmin,self.xmax = self.xmax,self.xmin 672 682 if self.xmin is not None: ax.set_xbound(lower=self.xmin) 673 683 if self.xmax is not None: ax.set_xbound(upper=self.xmax) 674 684 if self.ymin is not None: ax.set_ybound(lower=self.ymin) 675 685 if self.ymax is not None: ax.set_ybound(upper=self.ymax) 686 # set the number of ticks (hardcoded) 687 ax.xaxis.set_major_locator(MaxNLocator(10)) 688 ## specific modulo labels 689 if self.modx is not None: 690 ax = labelmodulo(ax,self.modx) 676 691 else: 677 692 ## A 2D MAP USING PROJECTIONS (basemap) -
trunk/UTIL/PYTHON/planetoplot_v2/set_ppclass.txt
r1008 r1027 10 10 # z-axis: possible names to search for. add in the line with a separating ; 11 11 # 12 altitude;Alt;presnivs;bottom_top;altitude_abg;lev;PTOT;vert 12 altitude;Alt;presnivs;bottom_top;altitude_abg;lev;PTOT;vert;p 13 13 # t-axis: possible names to search for. add in the line with a separating ; 14 14 #
Note: See TracChangeset
for help on using the changeset viewer.