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
   / \ \    / )   [EMAIL PROTECTED], http://www.wobsta.de/
  / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
 (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to