# Replicate effect of FrameTicks->All manually

I need a way to get the absolute tick specifications in the form of list of position/label pairs, and have not been able to come up with a robust way.

For the following, I'll be using this test plot:

plt = Plot[x, {x, 0, 1}, Frame -> True, PlotRangePadding -> 0]


Things I have tried so far include:

• Specifying ChartingScaledTicks[{Identity,Identity}]:

Notice the missing 1.0 tick mark.

• Using AbsoluteOptions:

InputForm@PlotRange /. Quiet@AbsoluteOptions@plt
(* {{0., 1.}, {0., 0.9999999795918367}} *)


This probably also explains why the above fails.

• PlotRange@plt, ChartingCommonDumpgetplotrange@plt and GraphicsInformation@plt all fail similarly

• FullGraphics is also completely broken
• I tried to look at the GraphicsBox expression resulting from the plot, but the PlotRange is still wrong there and the FrameTicks have not yet been expanded.
• I also tried to look at the definitions of TypesetMakeBoxes, which appears to handle some of the option transformations for graphics, but I couldn't find anything, and they also seem to be unused during normal operation

Is there any way to replicate what the front end is doing? I guess it's just rounding the plot ranges before feeding them into whatever tick-making function it uses internally, but is there a way to tell what exactly is going on?

• Not sure what happened there, but try this: tt = ChartingScaledTicks[{Identity, Identity}][0, 3]; {Plot[2 x, {x, 0, 3}, Frame -> True, FrameTicks -> {None, {tt, None}}, PlotRangePadding -> 0], Plot[2 x, {x, 0, 3}, Frame -> True, FrameTicks -> {None, {Automatic, None}}, PlotRangePadding -> 0]} – J. M.'s technical difficulties Mar 19 '18 at 3:15
• @J.M. I'm aware that that will work - but I need a way to get the ticks for an arbitrary plot, where the plot range is not manually set to something nice. As I tried to explain in the question, the front-end seems to be doing some rounding, but if I want it to always work, I need to know what exactly is being done. – Lukas Lang Mar 19 '18 at 7:54
• @LukasLang, just saw this question, maybe too late, but... You probably aware of Chartingget2DPlotRange[Plot[...]], this gives true plot ranges used by MMA to plot and to place ticks. So for your plt it gives {{0.,1.},{0.,1.}}. Then ChartingScaledTicks[{Identity,Identity}][<here is plot range>] replicate MMA ticks. – Alx Aug 20 '19 at 7:06
• @Alx Thanks for the suggestion, but unfortunately I can't seem to get it to work. If you look at Chartingget2DPlotRange@plt // InputForm, $1$ is still excluded from the vertical plot range. – Lukas Lang Aug 20 '19 at 7:13
• I tried this way: pr=Chartingget2DPlotRange[plt], then Plot[x, {x, 0, 1}, Frame -> True, PlotRangePadding -> 0, FrameTicks -> ChartingScaledTicks[{Identity, Identity}][Sequence @@ pr[[2]]]] and all 1s are presented. – Alx Aug 20 '19 at 7:50