MATLAB 的 heatmap 坐标数字密集,希望等间距稀疏打印坐标刻度。
XLabels = 1:100; % Convert each number in the array into a string CustomXLabels = string(XLabels); % Replace all but the fifth elements by spaces CustomXLabels(mod(XLabels,5) ~= 0) = " "; % Set the 'XDisplayLabels' property of the heatmap % object 'h' to the custom x-axis tick labels h.XDisplayLabels = CustomXLabels;
因此可以将原始效果更改为间隔为 5 的坐标刻度。
或者隐藏坐标区数字
ax= gca; ax.XDisplayLabels = nan(size(ax.XDisplayData)); % 隐藏坐标区数字标号 ax.YDisplayLabels = nan(size(ax.YDisplayData));
感谢 https://www.cnblogs.com/sunny99/ sumoier对本文的帮助
标签:XDisplayLabels,CustomXLabels,heatmap,MATLAB,ax,坐标 From: https://www.cnblogs.com/Yi-920259020/p/18423176