Changeset 1020


Ignore:
Timestamp:
04/19/06 11:01:25 (18 years ago)
Author:
mar637
Message:

made matplotlib hack in save version dependend as this has been fixed in >0.85.*

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asaplotbase.py

    r1019 r1020  
    414414            try:
    415415                if fname[-3:].lower() == ".ps":
     416                    from matplotlib import __version__ as mv
    416417                    w = self.figure.figwidth.get()
    417418                    h = self.figure.figheight.get()
    418                     a4w = 8.25
    419                     a4h = 11.25
    420419
    421420                    if orientation is None:
     
    425424                        else:
    426425                            orientation = 'portrait'
    427                     ds = None
    428                     if orientation == 'landscape':
    429                         ds = min(a4h/w,a4w/h)
    430                     else:
    431                         ds = min(a4w/w,a4h/h)
    432                     ow = ds * w
    433                     oh = ds * h
    434                     self.figure.set_figsize_inches((ow,oh))
     426                    # hack to circument ps bug in eraly versions of mpl
     427                    if int(mv.split(".")[1]) < 86:
     428                        a4w = 8.25
     429                        a4h = 11.25
     430                        ds = None
     431                        if orientation == 'landscape':
     432                            ds = min(a4h/w,a4w/h)
     433                        else:
     434                            ds = min(a4w/w,a4h/h)
     435                        ow = ds * w
     436                        oh = ds * h
     437                        self.figure.set_figsize_inches((ow,oh))
    435438                    self.canvas.print_figure(fname,orientation=orientation)
    436439                    print 'Written file %s' % (fname)
Note: See TracChangeset for help on using the changeset viewer.