how plot a matrix on a wxframe?
Posted
by
milton
on Stack Overflow
See other posts from Stack Overflow
or by milton
Published on 2009-08-10T22:29:15Z
Indexed on
2011/02/05
23:25 UTC
Read the original article
Hit count: 233
I am starting on wx, and I need to plot a matrix (like a grid) that is stored on a list of lists on wx Frame. My matrix have to values, and I would like to set different colors for each values.
mymatrix=[[100,200,200,200,100,200,200,200,100,100],
[200,200,100,100,100,100,200,200,100,200],
[100,100,200,200,100,100,100,100,100,100],
[100,200,200,100,200,100,100,200,200,200],
[200,100,200,100,100,100,100,200,100,100],
[100,200,200,100,200,200,100,200,100,100],
[200,100,200,100,100,100,200,100,100,100],
[200,200,100,200,100,200,200,200,200,200],
[200,200,200,100,200,200,200,100,100,100],
[100,100,100,200,200,200,100,200,200,100]]
a = numpy.array(landscape_matrix)
im = Image.fromarray(a)
I can show it using im.show()
but I need to plot it on a wx frame.
All help is welcome.
© Stack Overflow or respective owner