Effacer les filtres
Effacer les filtres

Increase amplitude for an individual plot in a hold on multiplot

1 vue (au cours des 30 derniers jours)
georgina company
georgina company le 3 Fév 2019
Good morning, I have the following code:
VAR= rand(2000,4);
sepa=5;
for i=1:4
plot(VAR(:,i)+sepa*(i-1))
hold on
end
Which give me the following results. Now I would like to increase the amplitude (ylim) of one single signal of my plot.
How I should do this?
Thank you!
Figure.jpg

Réponses (1)

Areej Varamban Kallan
Areej Varamban Kallan le 7 Fév 2019
Hi Georgina,
In my understanding, you want to multiply the y-values of a particular plot by a constant factor so that the entire plot scales up. This can be achieved by getting the handle to the required plot and changing the property YData. For example, if you need to double the amplitude of the second plot, you can try the following:
VAR= rand(2000,4);
sepa=5;
for i=1:4
p(i) = plot(VAR(:,i)+sepa*(i-1));
hold on
end
p(2).YData = 2*p(2).YData;

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by