hello guys, I have a data like this and I want to set a upper and lower threshold values(different) for both the subplots seperately, can anyone help me with the code? Thanks in advance!!
1 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161832/image.png)
3 个评论
Image Analyst
2017-3-17
Perhaps do you mean y limits instead of threshold? Like how you'd set with the ylim() function?
回答(1 个)
Star Strider
2017-3-18
The easiest way to define the y-axis limit for each subplot:
YL1 = get(subplot(2,1,1),'YLim')
set(subplot(2,1,1), 'YLim',[5E-4 max(YL1)])
YL2 = get(subplot(2,1,2),'YLim')
set(subplot(2,1,2), 'YLim',[5E-4 max(YL2)])
These go after the subplot calls in your code.
This looks a bit redundant, but guarantees that the correct value for the maximum is set in each subplot.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!