Hi,

On 10.03.06, Alan G Isaac wrote:
> Has anyone implemented a nice SCATTERPLOT MATRIX?
> Examples:
> 
> - http://www.math.sfu.ca/~cschwarz/Stat-301/Handouts/node43.html
>   (Tab down once for an pretty good example.  Axis labeling 
>   would ideally alternate however.)
> - http://www.ncss.com/scatmatrix.html
>   (Go about half way down; note that including regression 
>   lines is a nice option)
> - 
> http://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/scatplma.htm
>  
>   (Go to the very bottom; this one does the labeling better)
> - http://www.mrc-bsu.cam.ac.uk/bugs/documentation/coda03/node34.html 
>   (Interesting approach; I'm uncertain about it however)

A straight forward way would be to just build up some graphs and link
the axis between them. See the enclosed example (scatter_linked).

However, there seems to be another, quite interesting solution: You
can use bar axes (or splitaxes --- those are basically the same) to do
a single graph and split it into several pieces. I'm not quite sure
how to deal with the internal borders here ... but this is somehow
solveable. Anyway, since it's kind of an interesting approach (and I
just don't know whether you want to play with it a bit), I've also
included a scatter_bar in the enclosed code.

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/
import random
from pyx import *

c = canvas.canvas()
g00 = c.insert(graph.graphxy(width=5, height=5))
g00.plot(graph.data.list([(random.random(), random.random()) for i in 
range(10)], x=1, y=2))

g01 = c.insert(graph.graphxy(width=5, height=5, ypos=6,
                             x=graph.axis.linkedaxis(g00.axes["x"])))
g01.plot(graph.data.list([(random.random(), 10*random.random()) for i in 
range(10)], x=1, y=2))

g10 = c.insert(graph.graphxy(width=5, height=5, xpos=6,
                             y=graph.axis.linkedaxis(g00.axes["y"])))
g10.plot(graph.data.list([(10*random.random(), random.random()) for i in 
range(10)], x=1, y=2))

g11 = c.insert(graph.graphxy(width=5, height=5, xpos=6, ypos=6,
                             x=graph.axis.linkedaxis(g10.axes["x"]),
                             y=graph.axis.linkedaxis(g01.axes["y"])))
g11.plot(graph.data.list([(10*random.random(), 10*random.random()) for i in 
range(10)], x=1, y=2))

c.writeEPSfile("scatter_linked")

########################################################

g = graph.graphxy(width=10, height=10,
                  x=graph.axis.bar(defaultsubaxis=graph.axis.linear()),
                  y=graph.axis.bar(defaultsubaxis=graph.axis.linear()))
g.plot([graph.data.list([((0, random.random()), (0, random.random())) for i in 
range(10)], x=1, y=2),
        graph.data.list([((0, random.random()), (1, 10*random.random())) for i 
in range(10)], x=1, y=2),
        graph.data.list([((1, 10*random.random()), (0, random.random())) for i 
in range(10)], x=1, y=2),
        graph.data.list([((1, 10*random.random()), (1, 10*random.random())) for 
i in range(10)], x=1, y=2)],
       [graph.style.symbol()]) # due to a bug of graph.data.list in 0.8.x we 
need to specify a style here
g.writeEPSfile("scatter_bar")

Reply via email to