[scilab-Users] heatmap / Matplot

duboism at limsi.fr duboism at limsi.fr
Sat Jun 7 11:54:38 CEST 2008


Hi Joshua,

I think that the function grayplot (and its friends fgrayplot, Sgrayplot)
would be useful for you but you will have to reformat your data.

grayplot takes 3 arguments: x (vector of x coordinates, size nx), y
(vector of y coordinates, size ny) and a nx*ny matrix data (the value at
data(i,j) is the value of point (x(i), y(j)) ). See the script
test_grayplot.sce.

It should not be hard to re-format your data this way.

Note the use of the zminmax option to plot different data with the same
color scale (see test_grayplot2.sce).
Note also that on the x86_64 architecture the function colorbar seems
broken (in fact you cannot use it since it raises an error).

Mathieu

> Hi,
>
> I am looking for some assistance.  I am trying to make what I know as a
> heatmap.  Basically I have data for many points on a grid and want to
> construct a 2d plot where each point is given a color on a gradient
> (From blue to red say) based on the data value at that point.  I have
> the data in the form of a matrix with 3 columns x-coord, y-coord, data
> value
>
> Currently I am making this type of plot by transforming my grid
> coordinates into matrix coordinates of a new matrix and scaling my data
> values into the range [0, NUM_COLORS] and using the Matplot function to
> plot this data.  This method does work, but has a few shortcomings: I
> lose the original scale of my grid since the axis labels are based on
> the matrix coordinates.  There is no key explaining the gradient and
> even if there were I would lose the original scale of my data values.
>
> Does anyone know how to get around these limitations or know of a better
> way to accomplish what I am trying to do?  I'd appreciate any help.
>
> Cheers,
> Josh
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_grayplot.sce
Type: application/octet-stream
Size: 389 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20080607/9a718f5d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_grayplot2.sce
Type: application/octet-stream
Size: 627 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20080607/9a718f5d/attachment-0001.obj>


More information about the users mailing list