Graphics error 2018b: How to move y tick labels next to ticks instead of on top of ticks

2 ビュー (過去 30 日間)
In Matlab 2018b, the y-tick numbers are plotted on top of the axis line (on top of the tick actually) and the tick dir seems to be outside instead of inside (reverse what it's supposed to be based on its setting). When I change the y numericruler direction setting to in or out, the problem persists: the numbers are on top of the ticks despite the tick being on the wrong side of the vertical axis-line.
How do I fix this error?
  1 件のコメント
Rik
Rik 2019 年 2 月 7 日
You should post your solution as an answer. That way it will be easier to tell for someone with a similar problem to find your solution.

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

採用された回答

Shawn Duenas
Shawn Duenas 2019 年 2 月 7 日
The thread below has a similar problem and seems to track it down to plotting log-scale and reverse direction. Seems like a Matlab plotting issue. A work around is to change the view instead of the axis direction.
To plot descending x-ticks, this works but creates the glitches above:
set(gca,'xdir','reverse')
The more robust approach is to change the axes view from [0,90] to [-180,-90] (although the above works for simple linear-linear plot, but not log-linear or log-log plots):
set(gca,'view',[-180,-90])
The old method works better because it lacks the y-tick errors, but is harder to remember.
I was hoping that flipping the view left-right would be easier in newer versions (that was the intent of adding 'xdir' and numericruler objects, but it's not in this case.
Hopefully 2019a will correct what seems to be an oversight by the Matlab programmers to handle reverse directions for log-scale cases.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by