Changeset 1004 for trunk/UTIL/PYTHON


Ignore:
Timestamp:
Jul 9, 2013, 12:54:04 AM (11 years ago)
Author:
aslmd
Message:

UTIL PYTHON planetoplot_v2. set xmin and ymin for 2D plots as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py

    r1002 r1004  
    341341                 units="",\
    342342                 modx=None,\
     343                 xmin=None,\
     344                 ymin=None,\
     345                 xmax=None,\
     346                 ymax=None,\
    343347                 title=""):
    344348        ## what could be defined by the user
     
    361365        self.colorb = colorb
    362366        self.modx = modx
     367        self.xmin = xmin
     368        self.ymin = ymin
     369        self.xmax = xmax
     370        self.ymax = ymax
    363371        ## other useful arguments
    364372        ## ... not used here in ppplot but need to be attached to plot object
     
    426434        self.marker = marker
    427435        self.label = label
    428         self.xmin = None
    429         self.ymin = None
    430         self.xmax = None
    431         self.ymax = None
    432436
    433437    # define_from_var
     
    650654                         zelevels, cmap=palette)
    651655            # make log axes and/or invert ordinate
     656            ax = mpl.gca()
    652657            if self.logx: mpl.semilogx()
    653658            if self.logy: mpl.semilogy()
    654             if self.invert: ax = mpl.gca() ; ax.set_ylim(ax.get_ylim()[::-1])
     659            if self.invert: ax.set_ylim(ax.get_ylim()[::-1])
     660            if self.xmin is not None: ax.set_xbound(lower=self.xmin)
     661            if self.xmax is not None: ax.set_xbound(upper=self.xmax)
     662            if self.ymin is not None: ax.set_ybound(lower=self.ymin)
     663            if self.ymax is not None: ax.set_ybound(upper=self.ymax)
    655664        else:
    656665            ## A 2D MAP USING PROJECTIONS (basemap)
Note: See TracChangeset for help on using the changeset viewer.