Setting a value for multiple axes handles at once (without a for-loop)
Show older comments
Hey all,
As the title suggests, I'm trying to prevent a for-loop in the following problem. Im working in MATLAB 2019b
I defined three subplots, and from each ylabel, I would like to get the minimum x-position. Here is a minimum working example, which does not work. But it identifies and explains my problem, see the added script. The final two lines don't work for the same reason.
The reason I'm into this problem is because I want to align my ylabels. Therefore, If a know the minimum value of one label, I can set the other labels to the same value.
Anyone who can help me with this problem?
Thanks in advance!
Gerard
figure
s1 = subplot(3, 1, 1);
s2 = subplot(3, 1, 2);
s3 = subplot(3, 1, 3);
axs(1) = ylabel(s1, '...');
axs(2) = ylabel(s2, '...');
axs(3) = ylabel(s3, '...');
axs(:).Units = 'centimeters';
mxP = min(axs(:).Position(1));
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!