I can't figure out how to get PyX to plot a rectangle filled with a
color gradient (eg., so that the color varies as y varies).
I want to use this is a key for a graph. I have some 3D data that I'd
like to plot as a 2D scatter plot, and show the last dimension with
the color of each point. I think I can follow this example:
to take care of the plotting.
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?
From: Stefan Schenk <Micromind.B<rainworks@gm...> - 2007-07-19 05:57:54
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
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,
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),
Get latest updates about Open Source Projects, Conferences and News.