|
From: Eric F. <ef...@ha...> - 2009-03-24 19:22:59
|
Christopher Barker wrote:
> Hi folks,
>
> Is there an OO way to get pyplot.axhline() ?
>
> I found Axes.hlines, but it's not as convienent for doing a quick
> horizontal line all the way across the axes: I need to specify the x coords.
>
> thanks,
>
> -Chris
>
>
Chris,
Maybe it is new, but svn trunk shows that pyplot.axhline is just calling
the axes method of the same name.
Eric
def axhline(*args, **kwargs):
# allow callers to override the hold state by passing hold=True|False
b = ishold()
h = kwargs.pop('hold', None)
if h is not None:
hold(h)
try:
ret = gca().axhline(*args, **kwargs)
draw_if_interactive()
except:
hold(b)
raise
hold(b)
return ret
if Axes.axhline.__doc__ is not None:
axhline.__doc__ = dedent(Axes.axhline.__doc__) + """
|