y-axis only absolute values
16 ビュー (過去 30 日間)
古いコメントを表示
Hi folks,
Is there a easy way to set the y-axis values to their absolute values such that there are only positive numbers on the y-axis?
Thank you for answers,
Cheers Sam
1 件のコメント
José-Luis
2014 年 6 月 13 日
What do you want to do about the negative values in your plot? Just not show them?
回答 (2 件)
dpb
2014 年 6 月 13 日
Sure,
plot(x,abs(y))
I'm guessing that's not what you mean, precisely, however. If you mean instead to simply display abs() of tick labels even if the y-limits include some negatives, then try
set(gca,'yticklabel',num2str(abs(get(gca,'ytick').')))
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!