Hi,
I want to scale the subplots. It should be scaled so that anyone can easily follow a point from top to bottom such as the figure attached here (Disp=1 in all subplots and small image means small force. Large image means large force in the figure)
thanks in advance

 Réponse acceptée

Star Strider
Star Strider le 2 Avr 2021

0 votes

I am not certain what result you want.
One option is the axis function. Use the same limits on each subplot so that they all have the same limits.

4 commentaires

ADNAN KIRAL
ADNAN KIRAL le 2 Avr 2021
Modifié(e) : ADNAN KIRAL le 2 Avr 2021
thanks for reply. How can i draw a line which can cut all subplots in the same point (top to bottom) as it is shown in the image?
here it is the script.
thanks in advance
figure;
subplot(3,1,1);
%%%some work here for x and y
plot(x,y)
subplot(3,1,2);
%%%some work here for x and y
plot(x,y)
subplot(3,1,3);
%%%some work here for x and y
plot(x,y)
My pleasure!
Two options:
xline(xval,'k')
using xline, or:
hold on
plot([1 1]*xval, ylim, 'k')
hold off
where ‘xval’ is the x-axis location to draw the vertical line.
So, since that appears to be 1 here:
xline(1,'k')
or:
hold on
plot([1 1], ylim, 'k')
hold off
Both of these automatically scale to the y-axis limits, so that does not have to be specifically coded.
ADNAN KIRAL
ADNAN KIRAL le 2 Avr 2021
THANKS again.
Star Strider
Star Strider le 2 Avr 2021
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by