[Scilab-users] Scilab checkerboard plot (grayplot)
Samuel Gougeon
sgougeon at free.fr
Sat Apr 22 11:15:16 CEST 2017
There was a mistake in the mapping (+zmax instead of +1).
And may be about data transposition. The following shows
0 in the bottom row, as the plot you posted:
function myMTIplot(data)
// Rescaling data to a given range of indices
nc = 32; // number of colors
zmin = -1;
zmax = 1;
data2 = (data - zmin)/(zmax-zmin)*(nc-1) + 1;
data2 = flipdim(data2',1);
// Plotting
clf
f = gcf();
f.color_map = jetcolormap(nc);
Matplot(data2)
a = gca();
colorbar(zmin, zmax);
xlabel("Impacting Group", "fontsize",4)
ylabel("Impacted Group", "fontsize", 4)
title("Relative MTI", "fontsize", 5);
[nrows, ncols] = size(data);
a.sub_ticks(1) = 0;
a.font_size = 3;
a.font_style = 8;
ticksText = tlist(["ticks", "locations", "labels"], 1:ncols, ..
["Plants", "Bacteria", "Det. Feeders", "Carnivores", "Detritus"]);
a.x_ticks = ticksText;
a.y_ticks = ticksText;
endfunction
data = csvRead("matrix.csv");
myMTIplot(M) --> flipdim(data',1)ans =0.4778269 -0.3005833 -0.0842439
0.0636698 -0.38217690.2895315 -0.1630711 0.5548875 -0.3547458
0.37435990.2895315 -0.1630711 -0.4451125 -0.3547458 0.37435990.4665757
-0.2942464 -0.1058069 0.0774553 0.60327540. 0. 0. 0. 0.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170422/c041c9bd/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aikplhkfgacflkca.png
Type: image/png
Size: 16544 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20170422/c041c9bd/attachment.png>
More information about the users
mailing list