From: Gary <pa...@in...> - 2004-09-07 13:10:57
|
Stephen Walton wrote: >On Mon, 2004-09-06 at 06:28, Alan G Isaac wrote: > > >>I'm a newbie to Matplotlib but a longtime gnuplot user. >>Using the matlab module, what is the right way to >>set xzeroaxis >> >> > >MATLAB doesn't have anything similar, AFAIK, but the following will >work: > >def xzeroaxis(form='k'): # draw a line at y=0 on the current plot > v=axis() > plot(v[0:2],[0,0],form) > > [...] I've accomplished this feature via: ax = axis() set(gca(). hlines([0.], ax[0], ax[1])[0], linewidth=1) I don't remember why I did it this way instead of just plotting. Maybe I thought is was more clever. Does this method avoid auto-scaling? -g |