Changeset 1559 for trunk


Ignore:
Timestamp:
03/30/09 17:03:01 (16 years ago)
Author:
Malte Marquarding
Message:

added forward for axes.annotate and added useful default plus interactive mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r1556 r1559  
    163163
    164164    text.__doc__ = matplotlib.axes.Axes.text.__doc__
     165
    165166    def arrow(self, *args, **kwargs):
    166167        if kwargs.has_key("interactive"):
     
    174175
    175176    arrow.__doc__ = matplotlib.axes.Axes.arrow.__doc__
     177
     178    def annotate(self, text, xy=None, xytext=None, **kwargs):
     179        if kwargs.has_key("interactive"):
     180            if kwargs.pop("interactive"):
     181                xy = self._plotter.get_point()
     182                xytext = self._plotter.get_point()
     183        if not kwargs.has_key("arrowprops"):
     184            kwargs["arrowprops"] = dict(arrowstyle="->")
     185        self._axes_callback("annotate", text, xy, xytext, **kwargs)
     186
     187    annotate.__doc__ = matplotlib.axes.Axes.annotate.__doc__
     188
    176189    def axvline(self, *args, **kwargs):
    177190        if kwargs.has_key("interactive"):
     
    180193                args = (pos[0],)+args
    181194        self._axes_callback("axvline", *args, **kwargs)
     195
    182196    axvline.__doc__ = matplotlib.axes.Axes.axvline.__doc__
    183197
     
    188202                args = (pos[1],)+args
    189203        self._axes_callback("axhline", *args, **kwargs)
     204
    190205    axhline.__doc__ = matplotlib.axes.Axes.axhline.__doc__
    191206
     
    216231        # This doesn't happen in a test script???
    217232        #del self._plotter.axes.patches[-1]
     233
    218234    axhspan.__doc__ = matplotlib.axes.Axes.axhspan.__doc__
    219235
Note: See TracChangeset for help on using the changeset viewer.