代码拉取完成,页面将自动刷新
同步操作将从 slandarer/MATLAB Special Heatmap 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
% Colormap
%% 调整clim(Adjust clim)
% 使用 clim() 或者 caxis() 调整颜色映射范围
% Use function clim() or caxis() to set the CLim
fig=figure('Position',[50,50,1400,700]);
% random data
Data=rand(12,12)-.5;
Data([4,5,13])=nan;
% subplot1
ax1=axes('Parent',fig,'Position',[0+1/40,0,1/2-1/20,1]);
SHM_ax1=SHeatmap(Data,'Format','sq','Parent',ax1);
SHM_ax1=SHM_ax1.draw();
SHM_ax1.setText();
% subplot2 adjust clim
ax2=axes('Parent',fig,'Position',[1/2+1/40,0,1/2-1/20,1]);
SHM_ax2=SHeatmap(Data,'Format','sq','Parent',ax2);
SHM_ax2=SHM_ax2.draw();
clim([-.8,.8])
SHM_ax2.setText();
% exportgraphics(fig,'gallery\Colormap_clim.png')
%% 使用MATLAB自带colormap(Use the built-in colormap in MATLAB)
figure()
Data=rand(14,14);
SHM_Bone=SHeatmap(Data,'Format','sq');
SHM_Bone.draw();
colormap(bone)
% exportgraphics(gca,'gallery\Colormap_bone.png')
%% slanCM(slanCM colormap)
% Zhaoxu Liu / slandarer (2023). 200 colormap
% (https://www.mathworks.com/matlabcentral/fileexchange/120088-200-colormap),
% MATLAB Central File Exchange. 检索来源 2023/3/15.
% 单向colormap或离散colormap
for i=[20,21,61,177]
figure()
Data=rand(14,14);
SHM_slan=SHeatmap(Data,'Format','sq');
SHM_slan.draw();
colormap(slanCM(i))
exportgraphics(gca,['gallery\Colormap_slanCM_',num2str(i),'.png'])
end
% 双向colormap(Diverging colormap)
for i=[141,136,134]
figure()
Data=rand(14,14)-.5;
SHM_slan=SHeatmap(Data,'Format','sq');
SHM_slan=SHM_slan.draw();
clim([-.7,.7])
colormap(slanCM(i))
SHM_slan.setText();
exportgraphics(gca,['gallery\Colormap_slanCM_',num2str(i),'.png'])
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。