Grid color for plotyy

5 ビュー (過去 30 日間)
Jesper Kamp Jensen
Jesper Kamp Jensen 2016 年 5 月 12 日
コメント済み: Walter Roberson 2016 年 5 月 12 日
Hi all,
I have a plotyy were I set the grid from the second Y-axis, but I cannot control the color of the grid - it turns out the same color as the series on the axis.
The code is below.
[hAx,hLine1,hLine2]=plotyy(Time,F_Hg,Time,HgConc);
set(hLine1,'marker','*','color','red','linestyle','none')
set(hLine2,'marker','+','color','blue','linestyle','none')
set(hAx,{'ycolor'},{'r';'b'}) % Left color blue, right color red
set(hAx(2),'Xgrid','on','Ygrid','on','YMinorGrid','on')
set(hAx(1),'YTick',[-5:1:5])
I hope you can help me out
Cheers, Jesper
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 5 月 12 日
Which release are you using?
Do I understand correctly that you want the grid to be a different color than the axes or the ticks?

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

回答 (1 件)

Jesper Kamp Jensen
Jesper Kamp Jensen 2016 年 5 月 12 日
And can someone tell me how to add a refline(0,1) to the hAx(2)?

カテゴリ

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