1
$\begingroup$

I stumbled upon a weird behaviour of Plot and ListLinePlot functions.

Let's plot a simple function

plot1 = Plot[Sin[x], {x, 0, 10}]

enter image description here

Now let's say I want to extract the "Ticks" element from the plot to later on manipulate it (a good example of manipulating ticks that I found very useful is here How can I scale tick marks without scaling my function? )

AbsoluteOptions[plot1, Ticks]

which gives me the ticks of the plot

(* {Ticks -> {{{0.,0., {0.00625, 0.}, {GrayLevel[0.],AbsoluteThickness[0.25]}}, .......*)

Now I plot the same function but add a frame

plot2 = Plot[Sin[x], {x, 0, 10}, Frame -> True] 

enter image description here

but when I try to extract the Ticks element, they are gone!?

AbsoluteOptions[plot2, Ticks]

{Ticks -> {{}, {}}}

Unless I'm missing something (which is likely) this is very strange. I haven't found a fix for this issue and it's is a problem if you want to have nice graphs with frame labels etc and also want to manipulate the Ticks.

Any help/ideas/feedback is always appreciate it.

Edit

FrameTicks also return an empty list

AbsoluteOptions[plot2, FrameTicks]
(*{FrameTicks -> {{}, {}, {}, {}}}*)
$\endgroup$
7

Browse other questions tagged or ask your own question.