From: Stephen W. <ste...@cs...> - 2004-09-07 02:26:15
|
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=3D'k'): # draw a line at y=3D0 on the current plot v=3Daxis() plot(v[0:2],[0,0],form) def yzeroaxis(form=3D'k'): v=3Daxis() plot([0,0],v[2:4],form) Is this worth adding to the distribution? I doubt it is general enough to warrant. John: when I do the following: v=3Darange(-5,5) plot(v,v**3) xzeroaxis() yzeroaxis() the vertical line at x=3D0 doesn't quite go to top and bottom of the plot. This is with 0.62.4. --=20 Stephen Walton <ste...@cs...> Dept. of Physics & Astronomy, CSU Northridge |