Scalar data map in Chaco

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Scalar data map in Chaco

Martin Gustafsson

I have some trouble making pseudo-color datamaps in Chaco. I have a 1D-array Trait for the x-scale and another one for the y-scale. There is also a 2D-array Trait for the actual data. The values in the axis arrays represent coordinates for the data points in the 2D-array, not pixel edges. That is, 2Darray.shape = (len(y_scale_array), len(x_scale_array)). I would like this plot to update automatically when either the data or the axis arrays change. I guess this means I need to use DataSources rather than sending arrays directly as arguments to Plot.img_plot?

It seems need to make meshgrids of the axis arrays, and should feed those to the Plot constructor as a GridDataSource. However, I need an ImageData source for the 2D-array too, and I'm not sure how to give more than one datasource to a Plot. Should I subclass AbstractDataSource to fit all the data into one DataSource? Or am I even on the right track at all? It all confuses me quite a lot, so it would help a lot if you could point me to an example.

Best wishes
Martin Gustafsson
Enthought-Dev mailing list
[hidden email]