Hi,

Am Mittwoch 18 Juli 2007 21:04 schrieb Imran Rashid:
> But I want to add a key to the graph, that would show how the color
> corresponds to the numerical value.
>
> is there anyway to do this?

Of course there is. Here is some code snippet i used some time ago for doing 
something similar. 


gridx = gridy = 50
c = canvas.canvas()

# ...

pal = []
for i in range(gridy):
    pal.append([0, 0.5, i*0.5/gridy, (i+1)*0.5/gridy, i*1.0/gridy])

gp = c.insert(graph.graphxy(height=2, width=0.5, xpos=12.5, ypos=4,
                            x=graph.axis.linear(parter=None),
                            y=graph.axis.linear(min=0, max=0.5, density=0.5)))

gp.plot(graph.data.list(pal, xmin=1, xmax=2, ymin=3, ymax=4, color=5),
        [graph.style.rect(color.palette.ReverseRainbow)])



HTH,
Stefan

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to