Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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 comentario
Rik
Rik el 7 de Feb. de 2019
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.

Iniciar sesión para comentar.

Respuesta aceptada

Shawn Duenas
Shawn Duenas el 7 de Feb. de 2019
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.

Más respuestas (0)

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by