4
$\begingroup$

This is similar to the closed topic: Frame ticks for a Log Log plot [closed]. Let me reuse (rm -rf)'s example here.

FrameTicks given through Show does not appear if used with LogLogPlot:

Show[
  LogLogPlot[x^2 + x^3, {x, 1, 100}, Frame -> True],
  FrameTicks -> {{All, None}, {{10, 30, 75}, None}}
]

This works though:

Show[
  LogLogPlot[x^2 + x^3, {x, 1, 100}, Frame -> True],
  FrameTicks -> {{All, None}, {{N@Log@#, #}& /@ {10, 30, 75}, None}}
]

Is this a bug or an expected behaviour?

$\endgroup$
1
  • $\begingroup$ Great that your question gives a copiable solution to my problem... $\endgroup$
    – Chromatic
    Commented Nov 19, 2015 at 18:58

1 Answer 1

5
$\begingroup$

This is not a bug, but a difference in how the ticks are processed. When given as part of LogLogPlot, they are scaled before they are displayed. You can see this if you extract them from the Graphics object:

LogLogPlot[x^2 + x^3, {x, 1, 100}, Frame -> True, 
   FrameTicks -> {{All, None}, {{10, 30, 75}, None}}] /.
 Graphics[_, opts : OptionsPattern[]] :> (FrameTicks /. Flatten@{opts})[[2]]

which returns

{{{2.30259, 10}, {3.4012, 30}, {4.31749, 75}}, None}

which is the same as

{{N@Log[#], #} & /@ {10, 30, 75}, None}

Notice that each tick is specified as {value, label}, and it is needed to place the ticks correctly while labeling them correctly. Now, Show does not do the same processing because it knows nothing about how the plot was put together; all it knows about is the Graphics object, itself.

$\endgroup$
1
  • $\begingroup$ Thank you very much. Now I understand Show more! $\endgroup$
    – Taiki
    Commented Apr 26, 2013 at 14:15

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.