Increase amplitude for an individual plot in a hold on multiplot
1 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(1 个)
Areej Varamban Kallan
2019-2-7
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;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!