MATLAB heat map

后端 未结 4 1088
时光取名叫无心
时光取名叫无心 2020-12-17 16:39

I am trying to create a heat map using MATLAB, but the default function in MATLAB program doesn\'t any sense to me.

http://www.mathworks.com/help/bioinfo/ref/heatmap

4条回答
  •  甜味超标
    2020-12-17 17:11

    HeatMap isn't actually standard function for this, it comes from the Bioinformatics Toolbox. The simple way of drawing a heatmap might be like:

     A = 1:50;          % matrix to draw
     colormap('hot');   % set colormap
     imagesc(A);        % draw image and scale colormap to values range
     colorbar;          % show color scale
    

    As @natan suggested, you might want to build your matrix first and then draw using image or imagesc. Also you migt want to see article on my blog which shows that some color sets are better for accessibility than others, e.g. for printing in grayscale or in color vision deficiency.

提交回复
热议问题