Changeset 1029 for trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
- Timestamp:
- Sep 5, 2013, 2:28:49 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
r1027 r1029 187 187 # a function for predefined figure sizes 188 188 def figuref(x=16,y=9): 189 mpl.figure(figsize=(x,y)) 189 fig = mpl.figure(figsize=(x,y)) 190 return fig 190 191 191 192 # a function to change color lines according to a color map (idea by A. Pottier) … … 208 209 subv, subh = subv_t[numplot],subh_t[numplot] 209 210 except: 210 print "!! WARNING !! no preset found from set_multiplot.txt, or this setting file was not found."211 print "!! WARNING !! (ignore if superpose mode) no preset found from set_multiplot.txt, or this setting file was not found." 211 212 subv = 1 ; subh = numplot 212 213 return subv,subh … … 355 356 xmax=None,\ 356 357 ymax=None,\ 358 nxticks=10,\ 359 nyticks=10,\ 357 360 title=""): 358 361 ## what could be defined by the user … … 379 382 self.xmax = xmax 380 383 self.ymax = ymax 384 self.nxticks = nxticks 385 self.nyticks = nyticks 381 386 ## other useful arguments 382 387 ## ... not used here in ppplot but need to be attached to plot object … … 532 537 ## set with .div the number of ticks. (is it better than automatic?) 533 538 if not self.logx: 534 ax.xaxis.set_major_locator(MaxNLocator(self.div/2)) 539 ax.xaxis.set_major_locator(MaxNLocator(self.div/2)) #TBD: with nxticks? 535 540 else: 536 541 print "!! WARNING. in logx mode, ticks are set automatically." … … 684 689 if self.ymin is not None: ax.set_ybound(lower=self.ymin) 685 690 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)) 691 # set the number of ticks 692 if not self.logx: 693 ax.xaxis.set_major_locator(MaxNLocator(self.nxticks)) 694 else: 695 print "!! WARNING. in logx mode, ticks are set automatically." 688 696 ## specific modulo labels 689 697 if self.modx is not None: … … 773 781 if self.back in back.keys(): 774 782 print "**** info: loading a background, please wait.",self.back 775 if self.back not in ["coast","sea"]: m.warpimage(back[self.back],scale=0.75) 776 elif self.back == "coast": m.drawcoastlines() 777 elif self.back == "sea": m.drawlsmask(land_color='white',ocean_color='aqua') 783 if self.back not in ["coast","sea"]: 784 try: m.warpimage(back[self.back],scale=0.75) 785 except: print "!! ERROR !! no background image could be loaded. probably not connected to the internet?" 786 elif self.back == "coast": 787 m.drawcoastlines() 788 elif self.back == "sea": 789 m.drawlsmask(land_color='white',ocean_color='aqua') 778 790 else: 779 791 print "!! ERROR !! requested background not defined. change name or fill in set_back.txt" ; exit()
Note: See TracChangeset
for help on using the changeset viewer.