From: Alan G I. <ai...@am...> - 2004-09-07 06:46:56
|
On Mon, 06 Sep 2004, John Hunter apparently wrote: > I've not used set xzeroaxis. I googled around a bit and gathered that > this draws a horizontal line from xmin to xmax at y=0. Right. > Fernando Perez and I talked a bit at scipy about > adding some gnuplot compatibility functions and this would fit under > that umbrella. I'm interested in getting some feedback about whether > folks think this is a good idea. I care about functionality much more than syntax. This is a common need, so it shd be easy to do. > from matplotlib.transforms import blend_xy_sep_transform > ax = gca() > trans = blend_xy_sep_transform( ax.transAxes, ax.transData) > plot([0,1], [0,0], transform=trans) > Try this out and see if it behaves as you like. So far so good. > Rather than reusing the gnuplot names, it might be better to > provide a method that always draws a line from xmin to xmax at a given > height regardless of the xlim, and do the same for a vertical line at > some x. I agree. I actually need the additional functionality. So while we're generalizing let me dream. Focus on the case of vertical lines. The ideal functionality would allow me to use 'vlines' with a special value to indicate ymin and ymax. Ideally this same 'special values' convention would extend to 'fill' (or maybe 'bar'), since I often need event shading. Perhaps the obvious special value is None? fwiw, Alan |