From: Andre W. <wo...@us...> - 2006-04-24 05:28:46
|
Hi Stathis, On 21.04.06, Stathis Sideris wrote: > I'm looking for a way to find the horizontal (x) position of a bar in a > bar graph. > > x = g.axes["x"].convert(("A", 1)); A bar axis is an axis, which is constructed out of set of linear axes of range 0 to 1 -- for each discrete bar value one linear axis. So you can modify the 1 in the line above to 0 to get the left point of the bar and to 0.5 to get the middle of the bar. Beside that you may consider writing an own graph style for your use-case (depending on whether you want to use your specific style needs in several plots). Its quite easy to access the middle of the bar, as the (implicit) parpos style already prepares this point (for use by the text or the errorbar styles). You may start from the graph.style.text-class, which really are quite a few lines of code and modify it to your needs. HTH, André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ |