Removing Primary Tick Marks from Secondary Axis Using Plotyy

2 ビュー (過去 30 日間)
Matt Brown
Matt Brown 2012 年 5 月 18 日
回答済み: Daniel 2015 年 3 月 2 日
I am trying to plot two sets of data using plotyy. Matlab automatically puts the tickmarks for the primary axis (left side) onto the secondary axis (right side). This makes the secondary axis difficult to read. How do I remove the primary ticks from the secondary axis?

採用された回答

Matt Brown
Matt Brown 2012 年 5 月 18 日
Never mind, I figured it out. You have to set the 'Box' property to 'Off' for the primary axis.
  1 件のコメント
Daniel Shub
Daniel Shub 2012 年 5 月 18 日
So why don't you accept this answer.

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

その他の回答 (1 件)

Daniel
Daniel 2015 年 3 月 2 日
I hit this issue as well when I changed the Ylim of the right plot. I got around it by changing the left plot Ylim in the same proportions (to realign the tick marks on the right and hide the left plot's behind the right plot's):
[hAx,hLine1,hLine2] = plotyy(X,Y1,X,Y2); set(hAx(2),'ylim',[0 1.2]); set(hAx(1),'ylim',get(hAx(1),'ylim').*[0 1.2]);
Cheers, Daniel

カテゴリ

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