Skip to main content

Timeline for Extract ticks from plot

Current License: CC BY-SA 3.0

15 events
when toggle format what by license comment
May 6, 2017 at 18:58 history edited Alexey Popkov
edited tags
Dec 2, 2016 at 21:43 vote accept Felix
Dec 2, 2016 at 14:38 history tweeted twitter.com/StackMma/status/804696237731680256
Dec 2, 2016 at 0:47 comment added Stitch That's easy. You can do Cases[plot, Rule[Ticks, t_] :> t, Infinity] to see if they are Automatic or not. Compare running on plot vs. plot2
Dec 1, 2016 at 23:48 answer added Mr.Wizard timeline score: 20
Dec 1, 2016 at 22:18 answer added Felix timeline score: 6
Dec 1, 2016 at 22:08 comment added Felix But it's not that AbsoluteOptions[plot, Ticks] would return something like "Automatic". How can it even distinguish, if I draw the same plot later, the output from manually added ticks at a spacing of 2.5? For instance, if I define the output of Karsten's comment by plot2 = Plot[Sin[x], {x, 0, 20}, Evaluate@AbsoluteOptions[plot, Ticks]]. If I then read AbsoluteOptions[plot2, Ticks] it is the same as the output of AbsoluteOptions[plot, Ticks], but printing plot and plot2 results in different ticks.
Dec 1, 2016 at 22:01 comment added Stitch I wonder if they determine it at render time if the settings are Automatic
Dec 1, 2016 at 22:00 comment added Stitch It seems like what is stored is not working for even some Mathematica functions. Read here about how FullGraphics complains about default settings.
Dec 1, 2016 at 21:57 comment added Felix That's good to know. However, I am most interested in using the automatically generated ticks in my custom plot function. Somehow, this information must be stored in the plot object, mustn't it?
Dec 1, 2016 at 21:55 comment added Stitch This behavior is only for Automatic settings, if you manually specify ticks and then read them through AbsoluteOptions you get the actual value. Try plot = Plot[Sin[x], {x, 0, 20}, Ticks -> {Range[0, 20, 5], Range[-1, 1, .5]}]
Dec 1, 2016 at 21:55 comment added Felix I am actually using CustomTicks to re-design the plot in my custom plot function. The entire purpose of the function is to take charge of all the design aspects of the plot without having to define so many options in the original plot command. So far, I extract the plot range from the ugly default plot and feed it to CustomTicks. The problem is that the tick spacing is too tight. CustomTicks with automatic spacing draws major ticks every 2.5 in the above example. I want to use the automatically rendered separation of 5.
Dec 1, 2016 at 21:34 comment added grbl I think AbsoluteOptions is deprecated. You can try the CustomTicks package.
Dec 1, 2016 at 21:34 comment added Karsten7 The ticks don't match with Plot[Sin[x], {x, 0, 20}, Evaluate@AbsoluteOptions[plot, Ticks]].
Dec 1, 2016 at 21:15 history asked Felix CC BY-SA 3.0