Unlike most Matlab plotting functions, heatmap is annoyingly heavy-handed. It really wants to be used as a quick browsing tool, with very little customization allowed.
You can extract the color data from it:
tbl = table(LastName,Age,Gender,SelfAssessedHealthStatus,...
h = heatmap(tbl,'Smoker','SelfAssessedHealthStatus');
Alternatively, you may want to look some histogram functions (e.g. histcounts2) to calculate heatmap-like values without the plotting overhead.
3 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/712078-is-it-possible-to-convert-a-heatmap-to-a-matrix#comment_1252633
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/712078-is-it-possible-to-convert-a-heatmap-to-a-matrix#comment_1252633
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/712078-is-it-possible-to-convert-a-heatmap-to-a-matrix#comment_1252753
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/712078-is-it-possible-to-convert-a-heatmap-to-a-matrix#comment_1252753
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/712078-is-it-possible-to-convert-a-heatmap-to-a-matrix#comment_1252843
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/712078-is-it-possible-to-convert-a-heatmap-to-a-matrix#comment_1252843
Sign in to comment.