On 23.02.06, Markus Meyer wrote:
> Another question: I want to add a custom
> axis to the bar graph, so that the axis shows a continuous value and not
> the bar's names. I tried the following:
> 
> from pyx import *
> import random
> 
> g = graph.graphxy(width=8,
>        x=graph.axis.bar(painter=None),
>        x3=graph.axis.lin(min=0, max=10, title="$t [s]$"))
> g.plot(graph.data.list([(i,random.random()) for i in xrange(0,20)],
>        xname=0, y=2), [graph.style.bar()])
> g.writePDFfile("bar")
> 
> Can I change this so the x3 axis is drawn where normally the bar axis
> would be?

The distances between axes is a global graph property. (Maybe that's a
bad decision and should be changed, but it's this way ever since I
started the graph module (really a long time ago) and nobody *ever*
complained so far.) So just add "axesdist=0" to the graph constructor
and be happy ... ;-)

BTW: You will not get a linked axis x4 (containing the ticks).
Unfortunately where is no easy way in PyX 0.8.1 (and below) to do
this, but in the current CVS head we can easily create all kind of
linked axes within a graph, cyclic between graphs etc.

Another note: I urgently request you do differentiate between bar
graphs and histograms. Bar graphs "live" on a discrete axis and
histograms on a continuous axis. While we didn't had a histrogram
style for some time while already having bar graphs, people started to
missuse bar graphs for histograms. It works in the sense that you can
create whatever output you want, but I don't like it at all.


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/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to