Ticket #153: asaplotbase.py.patch

File asaplotbase.py.patch, 956 bytes (added by Malte Marquarding, 15 years ago)

plotter patch fro asap2.3.0

  • asaplotbase.py

    old new  
    775775        # a rough estimate for the bb of the text
    776776        if rotate > 0.0: lbloffset = 0.03*len(label)
    777777        peakoffset = 0.01
    778         xy0 = ax.transData.xy_tup((x,y))
    779         # get relative coords
    780         xy = ax.transAxes.inverse_xy_tup(xy0)
     778        xy = None
     779        xy0 = None
     780        # matplotlib api change 0.98 is using transform now
     781        if hasattr(ax.transData, "inverse_xy_tup"):
     782            # get relative coords
     783            xy0 = ax.transData.xy_tup((x,y))
     784            xy = ax.transAxes.inverse_xy_tup(xy0)
     785        else:
     786            xy0 = ax.transData.transform((x,y))
     787            # get relative coords
     788            xy = ax.transAxes.inverted().transform(xy0)
    781789        if location.lower() == 'top':
    782790            ymax = 1.0-lbloffset
    783791            ymin = xy[1]+peakoffset