Is the margin between the Axes' Position and OuterPosition uncontrollable?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
When I run the following code, the result is as shown in the attached image (margins are filled in with Paint for clarity). Is it possible to adjust the height and width of the OuterPostion to the same height and width of the TightInset to eliminate unnecessary margins?
plot(rand(1,20))
ax = gca;
ax.Position(1)=0;
ax.OuterPosition(1)=0;
ax.OuterPosition(3)=1;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/576317/image.png)
0 Commenti
Risposta accettata
Akiko
il 8 Apr 2021
You can refer the following documentation.
(To see this page, please login MathWorks Account.)
FYI:
ax = gca;
outerpos = ax.OuterPosition;
ti = ax.TightInset;
left = outerpos(1) + ti(1);
bottom = outerpos(2) + ti(2);
ax_width = outerpos(3) - ti(1) - ti(3);
ax_height = outerpos(4) - ti(2) - ti(4);
ax.Position = [left bottom ax_width ax_height];
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!