On 29.11.05, Michael Strass wrote:
> Sorry, I did not send to the list. Here it comes:

Damn. Now we need to repeat our private discussion on the list. ;-)

> > This should work, but it'll not create axes which are linked to each
> > other. Doesn't it?
> 
> You're right. This doesn't create a linked axis. But it doesn't help a
> bit. Compiling the stuff I get the error:
> 
> Traceback (most recent call last):
>   File "<stdin>", line 22, in ?
>   File "~strasmic/python/PyX-0.8.1/pyx/canvas.py", line 323, in
> wrappedindocument
>     return method(d, filename)
>   File "~strasmic/python/PyX-0.8.1/pyx/document.py", line 138, in
> writeEPSfile
>     pswriter.epswriter(self, filename, *args, **kwargs)
>   File "~strasmic/python/PyX-0.8.1/pyx/pswriter.py", line 235, in __init__
>     bbox = page.bbox()
>   File "~strasmic/python/PyX-0.8.1/pyx/document.py", line 78, in bbox
>     bbox = self.canvas.bbox()
>   File "~strasmic/python/PyX-0.8.1/pyx/graph/graph.py", line 445, in bbox
>     self.finish()
>   File "~strasmic/python/PyX-0.8.1/pyx/graph/graph.py", line 342, in finish
>     self.domethods[0]()
>   File "~strasmic/python/PyX-0.8.1/pyx/graph/graph.py", line 275, in
> dolayout
>     self.axes[key].create(self.texrunner)
>   File "~strasmic/python/PyX-0.8.1/pyx/graph/axis/axis.py", line 526, in
> create
>     self.canvas = self.axis.create(self.data, self.positioner,
> graphtexrunner, self.errorname)
>   File "~strasmic/python/PyX-0.8.1/pyx/graph/axis/axis.py", line 140, in
> create
>     raise RuntimeError("incomplete axis range%s" % errorname)
> RuntimeError: incomplete axis range for axis x2

Since the axes become independend from each others by that, you need
to provide some axis range for all axes, i.e. add some data for x2 and
y2 or set min and max values. Feature.

> Just for the record. The following code does what I want:
> 
> from pyx import *
> 
> d = graph.data.list([(1,  0.3),
>                      (2,  0.5),
>                      (3, -0.3),
>                      (4,  0.8),
>                      (5,  0.5)], x=1, y=2)
> 
> mypainter =
> graph.axis.painter.regular(basepathattrs=[style.linewidth.THIck])
> g = graph.graphxy(width=8,
>                   x=graph.axis.lin(painter=mypainter,
> linkpainter=mypainter),
>                   y=graph.axis.lin(painter=mypainter,
> linkpainter=mypainter))
> g.plot(d, [graph.style.line()])
> g.writeEPSfile("xy_axis")

Since you basically want to change the border of the graph, you could
alternatively stroke the background ...


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: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to