如何增加图形的大小而不划分我的情节?

62 views (last 30 days)
Hi,
I'm plotting a 3d mesh along with a colorbar on the side. Unfortunately the default figure size is cropping my colormap labels. I've tried changing my figure's position attribute, but then it changes my plot aspect ratio.
如何增加图形的大小而不划分我的情节?
Thanks,
Vinícius。
4条评论
Vinicius Belarmino Almeida
Vinicius Belarmino Almeida 2021年8月22日
我可以滥用,但只能在一定程度上,这并不能完全解决问题,我宁愿不走这条路线。
I don't see a parameter for the tick labels angle :( But I don't think it would fit anyways

Sign in to comment.

Accepted Answer

Dave B
Dave B 2021年8月22日
A few different solutions (demos below):
  • 如果您不希望变化的数字位置改变纵横比,请设置纵横比。轴上有两个控件:plotboxAspectratio和dataAspectratio。他们的互动方式可能会令人困惑,因此最好尝试获得所需的结果。详细信息://www.tianjin-qmedu.com/help/matlab/creating_plots/manipulating-axes-aspect-ratio.html
  • 设置轴的位置,而不是图形,ithink这就是您所追求的?
  • 当轴处于TileChartLayout中时,我们在定位配色栏方面做得更好。因此,听起来很奇怪,布局中的单个轴可能会更好地为配色栏提供适当的空间。我们正在尝试通过每个发行版来改进这一点,但是如果您正在使用2021A,如问题所述,应该非常好。但是,这将调整纵横比,因此请参见上文,以了解如何限制它。
% 原来的:
f =图;
ax =轴;
冲浪(峰);
配色栏('ticklabels',“很长的tick标签”);
title('原来的');
纵横比的%限制,数字位置调整了
f =图;
ax =轴;
冲浪(峰);
配色栏('ticklabels',“很长的tick标签”);
F.位置(3)= 1000;
ax.PlotBoxAspectRatio=[1 1 1];
title(“调整了数字位置,没有好多了”)
调整了%轴位置以使空间
f =图;
ax =轴;
冲浪(峰);
配色栏('ticklabels',“很长的tick标签”);
ax.OuterPosition(3:4)=.75;
title(“调整轴位置”)
% TiledChartLayout approach
f =图;
ax=nexttile;
冲浪(峰);
配色栏('ticklabels',“很长的tick标签”);
title('TiledChartLayout: may cramp your axes')
% TiledChartLayout with constrained aspect ratio
f =图;
ax=nexttile;
冲浪(峰);
ax.dataAspectratio = [1 1 .5];
配色栏('ticklabels',“很长的tick标签”);
title('TiledChartLayout + DataAspectRatio')
2 Comments
Vinicius Belarmino Almeida
Unfortunately I can't use a footnote or even separate the legend from the plot. All the info must be next to the plot in this case...
只要我设置纵横比,瓷砖图表的布局似乎是我最简单的解决方案。
Thanks!

Sign in to comment.

更多的Answers (0)

s manbetx 845


发布

R2021A

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

开始狩猎!