8
$\begingroup$

Ticks or Frameticks are defined in the following way:

{{x1,label1,len1},...}  tick marks with specified scaled length 

With the following information:

Tick mark lengths are given as a fraction of the distance across the whole plot. 

That means if I combine two plot with different Aspect ratios, the length of the ticks will not be the same. This is not wanted. Of course I can now manually equalize them, but this is not easy. Is there an Option for an AbsoluteLength? Like AbsoluteThickness or AbsolutePointsize?

$\endgroup$
1
  • 6
    $\begingroup$ As far as I know, this is still not possible. I have submitted a feature request for this exact thing around 2 years ago, but have not heard anything since (neither updates nor workarounds) $\endgroup$
    – Lukas Lang
    Sep 26, 2022 at 16:32

1 Answer 1

2
$\begingroup$

We may extract the absolute values for ticks using AbsoluteOptions. We may then change these options to our liking and reinsert them:

We create an example plot:

pl = Plot[Sin[x], {x, 0, 2 Pi}];

Then we extract the information about ticks:

ti0 = Ticks /. AbsoluteOptions[pl];

The specifications have the form: {position,label,{positive tick length, negative tick length}}. We change now the tick length and reinsert it using Show:

Do[
 ti = ti0 /. {x1_, x2_, {x3_, x4_}} -> {x1, x2, {len, 0}};
 Show[pl, Ticks -> ti] // Print;
 , {len, {0.01, 0.02, 0.04}}]

enter image description here

$\endgroup$
1
  • 4
    $\begingroup$ Unless I'm missing something, this doesn't relate to the question on how to achieve ticks with an absolute length? $\endgroup$
    – Lukas Lang
    Sep 26, 2022 at 18:12

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.