Hi Dear Community,
Today I'm dealing with a heatmap chart to make it look visually beautiful as much as possible. Here below I created some random data with some empty values in it. Later on I realized that the grid color is black and does not change. Also I couldn't find any of these properties: GridAlpha, EdgeAlpha, GridColor, GridLineStyle etc. I was able to control these properties when I use histogram2.
So I thought that if it is a figure and a plot in it, there should be an axis handle for that. I used gca to get axis but it returned me the heatmap object handle itself.
Then I found something interesting and convert the object handle to struct. The Axes field was actually the axis handle. I changed the XAxisLocation to top.
I reached the other properties of the axis but the properties about grid appereance does not work. Eventually, I decided to make grid visible off. But this time it does not look good and hard to understand grid edges.
My goal is make the visualisation plain, with less ink, and understandable.
So my question is how to reduce the GridAlpha on heatmap? Or how can I change its color to white to make it look simple?
heatmap_data = randi(20,15,15);
heatmap_data(heatmap_data < 15) = NaN;
label_names = cellstr(['A':'O']')';
h_fig = figure;
h_fig.WindowState = 'maximized';
h_map = heatmap(h_fig,label_names,label_names,heatmap_data,'MissingDataColor',[1 1 1],'ColorbarVisible','off');
h_ax = gca;
h_ruler = struct(h_ax);
h_ruler.Axes.XAxisLocation = 'top';
h_ruler.Axes.GridLineStyle = '--';
h_ruler.Axes.GridAlpha = 0.1;
h_ruler.Axes.GridColor = [0.8510 0.3294 0.1020];
h_map.GridVisible = 'off';