How can I set the exact position of subplots in a figure?
191 次查看(过去 30 天)
显示 更早的评论
Hello Matlab-Pros,
I want to create subplots in a specific position on a figure. How can I achieve this? Does somebody have an idea?
On the following picture, you can see a screenshot of the figure and the highlighted position where the subplot should be created.
Thanks in advance,
Mike
0 个评论
采纳的回答
Ameer Hamza
2018-5-14
编辑:Ameer Hamza
2018-5-14
If you want to create an axis on the specified location on the figure, just use
ax = axes('Position', [left bottom width height])
this will create an axis starting from the specified lower left corner with specified width and height. It will also return the axes handle ax.
Note that the values are specified in normalized units, i.e. the position values can change from 0 to 1.
4 个评论
Ameer Hamza
2018-5-14
If you just want to use subplot instead of axes() then you can still do what you want. For example
% instead of axes() use this.
ax = subplot(121) % 121 is for example
ax.Position = [] % define your position
will work too.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!