Borrar filtros
Borrar filtros

Increase amplitude for an individual plot in a hold on multiplot

1 visualización (últimos 30 días)
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

Respuestas (1)

Areej Varamban Kallan
Areej Varamban Kallan el 7 de Feb. de 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;

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by