1
$\begingroup$

In a normal plot in mathematica, the ticklabel is automatically changing its position if the length of the tick changes. Here is an Example:

Plot[x, {x, 0, 1}, Ticks -> {{{0.5, 0.5, {0, 0.1}}}, None}]

enter image description here

But strangely, it is not working if a frame is used instead of an axis.

Plot[x, {x, 0, 1}, FrameTicks -> {{None, None}, {{{0.5, 0.5, {0, 0.1}}}, None}}, Frame -> True]

enter image description here

Somehow the problem is related to the AspectRatio, because the changed height of the frameticklabel is the correct one for an AspectRatio of 1:

Plot[x, {x, 0, 1},FrameTicks -> {{None, None}, {{{0.5, 0.5, {0, 0.1}}}, None}},Frame -> True,AspectRatio -> 1]

enter image description here

Is there a simple hotfix or an easy way to manually adjust the distance between tick and ticklabel to avoid this problem?

$\endgroup$
2
  • 1
    $\begingroup$ The scaled length for left/right is based on the width of the frame for both the tick and the label. However, in the top/bottom direction the scaled length is correctly based on the height of the frame for the label, but remains based on the width of the frame for the tick. $\endgroup$ Jul 8, 2022 at 12:38
  • $\begingroup$ This is a good explanation for where this bug is coming from. But it is definitely not the behavior, which is wanted. This is obvious since Axes behaves correctly and at the same time differently than Frame. This looks to me like this issue was manually fixed in Axes and forgotten for Frame. But it can be somewhat fixed manually in this manner: mathematica.stackexchange.com/questions/221582/… $\endgroup$ Jul 17, 2022 at 10:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.