From: John H. <jdh...@ac...> - 2004-09-22 12:34:10
|
>>>>> "Alan" == Alan G Isaac <ai...@am...> writes: Alan> Now that you have given us axhline as a generalization of Alan> gnuplot's set xzeroaxis please consider letting xticks take Alan> an optional "loc" argument, which could either be "border" Alan> or a number to be interpreted as a 'y' value. Alan> So, e.g., axhline() xticks(arange(5),loc=0) would draw an Alan> xzeroaxis and put the xtics along it. Alan> Am I overlooking an obvious way to do this (in the matlab Alan> module)? Andrew Straw contacted me earlier about a related issue, that is, to be able to offset the x axis line, ticks, and label away from the data region, as in http://dickinson.caltech.edu/research_visualflightcontrol.html. I think this is a generally useful thing. Currently, the axes border is drawn as a rectangle, with a facecolor and the border determined by the rectangle edgecolor. The ticks are then placed on the rectangle border. The proposal is to change this behavior, so that the rectangle border edgecolor becomes the same as the facecolor (ie invisible border). The border is then replaced by four lines, call them bottom, top, left and right. Each of these four lines could be placed independently in axes coords: 0,0,1,1 = left, bottom, right, top. Eg, the bottom line would default to bottom = Line2D([0,1], [0,0], transform=ax.transAxes) ie it the x range would stretch from 0-1 (left-right) and the y coord would be 0 (bottom) in axes coords. To offset this line below the data range (the white rectangle defined by the axes box) you could, for example, make the ycoord -0.1. To place the x axes in the middle of the axes box, you would make the ycoord 0.5. However, there is a rub. Sometimes you probably want to place the xaxes y location in data units, eg at y=0. Note that this is not the same as y=0 in axes coords, which is always the bottom of the rectangle. This is possible since matplotlib lets you specify the x and y data in different data coordinate systems, eg with http://matplotlib.sourceforge.net/matplotlib.transforms.html#-blend_xy_sep_transform, but I think it would take some work to make the interface easy and intuitive. The other trick, from the developer side, is to couple the location of the ticks and tick labels to the y coord of the axes line. Doable, certainly, but would require some redesign because currently they all "know" their location. JDH |