Plotting two loglog y-axes

1 回表示 (過去 30 日間)
Jim
Jim 2012 年 11 月 20 日
Is there an equivalent function to plotyy that allows you to plot two different loglog y-axes with different scales using the same x-axis?
For example:
x = [1 2 3 4 5 6 7 8 9 10]
y1 = [2 4 6 8 10 12 14 16 18 20]
y2 = [10 20 40 80 160 320 640 1280 2560 5120]

採用された回答

Matt Fig
Matt Fig 2012 年 11 月 20 日
編集済み: Matt Fig 2012 年 11 月 20 日
AX = plotyy(x,y1,x,y2);
set(AX,'yscale','log') % And maybe xscale too?
  2 件のコメント
Jim
Jim 2012 年 11 月 20 日
Thanks Matt. That got me closer. For some reason it's not showing the y-axis tick marks though. Any idea how I can change the scale on just one of the y-axis and show just the points not the lines? It seems the plotyy command always shows the lines.
Matt Fig
Matt Fig 2012 年 11 月 20 日
編集済み: Matt Fig 2012 年 11 月 20 日
Yeah, you can play around with different properties of the axes. Try this out, for example:
set(AX,'ytickmode','auto')
And perhaps:
set(AX(1),'ylim',[1 100])

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by