Setting plot axis defaults not consistent

3 ビュー (過去 30 日間)
CustomBuilt
CustomBuilt 2016 年 3 月 28 日
回答済み: Mike Garrity 2016 年 3 月 28 日
I like the minor gridlines on for a polished looking plot.
The set() method is resulting in inconsistent results,
>>set(groot,'defaultLineLineWidth',2)
works as expected
>>set(groot,'defaultAxesXMinorGrid','on')
has no affect

採用された回答

Mike Garrity
Mike Garrity 2016 年 3 月 28 日
That's because XMinorGrid is one of those things that some plotting functions want to set one way and some want to set another way. For example, semilogx is wants to set it to 'on', but semilogy wants to set it to 'off'.
Because of this, in addition to setting the default, you need to tell the plotting functions that you're taking control. To do that, you set the Mode in addition to the value:
set(groot,'defaultAxesXMinorGrid','on','defaultAxesXMinorGridMode','manual')
This isn't needed with something like LineWidth because the plotting functions always use the default for that.

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by