Cannot set the tick mark direction as default

I recently switched to 2014b MATLAB, and I can no longer set the axes tick mark direction as default. That is, I used to be able to set the tick mark direction 'outward' by
set(0,'defaultAxesTickDir','out');
However, this command does not work any more. When I plot a new figure, the tick mark direction always becomes inward. I can still correct the direction by
set(gca,'TickDir','out');
each time I plot a figure, but this is very inconvenient. Does anybody knows how to work around this problem?

 採用された回答

Doug Hull
Doug Hull 2014 年 11 月 18 日

1 投票

From our development staff:
set(groot, 'defaultAxesTickDir', 'out');
set(groot, 'defaultAxesTickDirMode', 'manual');
plot(1:10)
It is important that you set these two defaults in this order to be effective.

3 件のコメント

Shin
Shin 2014 年 11 月 18 日
Thank you for providing the solution.
Shin
Shin 2014 年 11 月 18 日
I would also like to remove the box around the plot, but the following command does not work:
set(groot,'defaultAxesBox','off')
I would appreciate if you could also show me how to turn off the box by default. Do I have to set another default property to reflect the change?
Star Strider
Star Strider 2014 年 11 月 19 日
As I read the documentation, setting any property to something other than the default automatically sets the associated ‘Mode’ setting to 'manual'. When did that change? Can TMW change it back so it does?

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

その他の回答 (2 件)

Adam
Adam 2014 年 11 月 17 日
編集済み: Adam 2014 年 11 月 17 日

0 投票

Try
set( groot, 'defaultAxesTickDir', 'out' )
instead. Since graphics objects are now all actual objects rather than magic doubles the '0' handle no longer exists so groot is now the graphics root.
Shin
Shin 2014 年 11 月 17 日
編集済み: Shin 2014 年 11 月 17 日

0 投票

Thanks for the advice. Unfortunately, using 'groot' does not solve the problem in MATLAB 2014b. For example, please try:
set( groot, 'defaultAxesTickDir', 'out' )
figure;plot(1:5,1:5)
MATLAB still plots tick marks inward.

4 件のコメント

Star Strider
Star Strider 2014 年 11 月 17 日
That doesn’t seem to be an accessible ‘root’ property in R2014b. Setting it for each figure is your only option.
Adam
Adam 2014 年 11 月 17 日
編集済み: Adam 2014 年 11 月 17 日
That looks like a bug because if I do:
set( groot, 'defaultAxesTickDir', 'out' )
get( groot, 'defaultAxesTickDir' )
ans =
out
it clearly shows it has set the property, but it is not picking it up in the subsequent plot instruction.
set( groot, 'defaultFigurePosition', [400 400 200 200] )
for example does do exactly what you would expect.
Star Strider
Star Strider 2014 年 11 月 17 日
Agreed. You can set it but it doesn’t do anything. It’s not listed in the groot properties. Another reason to not uninstall R2014a.
Shin
Shin 2014 年 11 月 17 日
Thanks for checking out the problem. I guess we will have to set the axes property each time we plot a figure until the bug gets fixed...

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

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

製品

タグ

質問済み:

2014 年 11 月 17 日

コメント済み:

2014 年 11 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by