XGrid

68 ビュー (過去 30 日間)
Nicolas
Nicolas 2011 年 8 月 19 日
Hi,
I'm looking to set up the Xgrid on but only for the zero value,
i wrote that
set(gca,'XTick',0,'XGrid','on')
but only zero is tick on the figure, maybe the other way would be to plot a vertical line for x =0, but how do I choose y to be the min and max of my figure instead of my data ?
Cheers

採用された回答

Daniel Shub
Daniel Shub 2011 年 8 月 19 日
plot([0, 0], [min(ylim), max(ylim)], 'k:');

その他の回答 (1 件)

Nicolas
Nicolas 2011 年 8 月 19 日
ylim=ylim(subplot(4,5,j));
yMinor=linspace(ylim(1),ylim(2),length(s(:,1)));
p=zeros(1,length(s(:,1)));
plot(p,yMinor,'--k')
  1 件のコメント
Daniel Shub
Daniel Shub 2011 年 8 月 19 日
In general it is bad practice to use function names as variable names as is done here with ylim=ylim( ...
For your own sanity later call ylim something else.

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

カテゴリ

Help Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by