Changing Scale on Plotyy

3 次查看(过去 30 天)
T
T 2013-8-27
Suppose you want to use plotyy,
one function ranges from [0,1], the other function ranges from [-1,10000]
Suppose that in the section function, it's minimum value is say -.67, when you plot them together, the second function appears above the first one due to the range, suppose I want to bring it down, how would I do this?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-8-27
编辑:Azzi Abdelmalek 2013-8-27
[ax,h1,h2]=plotyy(x1,y1,x2,y2)
use the handle ax(1) to change the first axis and ax(2) to change the second one
For example
set(ax(2),'ylim',[ymin ymax])
  3 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2013-8-27
编辑:Azzi Abdelmalek 2013-8-27
You can control your scale
set(ax(2),'ylim',[min(y2) max(y2)])
T
T 2013-9-11
What if I only want to specify the minimum and leave the maximum alone? Specifying the max, tapers off the graph and I want some space above the function to display.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Two y-axis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by