美文网首页
Matlab 图片调整(文本、坐标轴、颜色等)

Matlab 图片调整(文本、坐标轴、颜色等)

作者: 吵吵人 | 来源:发表于2019-10-24 16:43 被阅读0次

文本

 text(x(maxIndex), maxVal, {['    X: ' num2str(x(maxIndex))];['    Y: ' num2str(maxVal)]})

其中,x(maxIndex), maxVal是文本位置,{[…];[…]}是所写文字。
效果如下:


坐标轴

%调整坐标轴刻度
XLim= get(gca,'XLim');
YLim= get(gca,'YLim');
XLim = XLim + [-1 0] * 0.01 * diff(XLim);
YLim = YLim + [-1 0] * 0.01 * diff(YLim);
set(gca,'xlim',XLim,'ylim',YLim);

%显示最小刻度、设置坐标轴标签
set(gca,'XMinorTick','on','YMinorTick','on','XTick',0:1:24);

颜色

% 添加颜色柱条并写说明、换颜色
h = colorbar;
h.Label.String = 'P';
colormap(jet); 

相关文章

网友评论

      本文标题:Matlab 图片调整(文本、坐标轴、颜色等)

      本文链接:https://www.haomeiwen.com/subject/rwvjmctx.html