# CustomTicks and small ranges

UPDATE

While the self-posted answer below (TickLabelStyle->TraditionalForm) works for most things, it also has the following effect: Integers are given periods in the label. That is, if the ticks would be at {1,2,3,4}, the labels are given as {"1.","2.","3.","4."} instead of the more pleasing {"1","2","3","4"}. Is there a better form or formatting function to use in this case?

I'm using the CustomTicks package from LevelScheme, and am having problems with displaying things when the range is very small ($10^{-11}$). For example, with default Mathematica:

ListPlot[{RandomReal[#], RandomReal[#]} & /@ (Range 10^-10),
Frame -> True, Axes -> False]


Gives While the equivalent, reproducible CustomTicks equivalent is:

ListPlot[{RandomReal[#], RandomReal[#]} & /@ (Range 10^-10),
Frame -> True, Axes -> False,
FrameTicks -> {LinTicks, LinTicks, StripTickLabels@LinTicks,
StripTickLabels@LinTicks}]


which gives: Erk. I must be missing something from the documentation, but I can't seem to find the right options. I want to eventually set more options for LinTicks (such as Tick length, etc), but this is a minimal example, and once this is solved, I can work on adding those options.

I can also double check that the range is set correctly by doing things slightly more by hand:

In:= data = {RandomReal[#],
RandomReal[#]} & /@ (Range 10^-10);
xRange = {Min@data[[All, 1]], Max@data[[All, 1]]}
yRange = {Min@data[[All, 2]], Max@data[[All, 2]]}

Out= {3.82894*10^-11, 9.18792*10^-9}

Out= {5.96584*10^-12, 9.54224*10^-9}

In:= ticks = FrameTicks -> {
LinTicks[xRange[], xRange[], MajorTickLength -> {0, 0.015},
MinorTickLength -> {0, 0.005}],
LinTicks[yRange[], yRange[], MajorTickLength -> {0, 0.015},
MinorTickLength -> {0, 0.005}],
StripTickLabels@LinTicks[xRange[], xRange[]],
StripTickLabels@LinTicks[yRange[], yRange[]]
}


Output omitted, but the range from LinTicks is correct. The x axis is $2\times 10^{-9}$ to $9\times 10^{-9}$, so they should output fine.

ListPlot[data, Frame -> True, Axes -> False, ticks]


Gives Any ideas?

• damn it, I of course found an answer as soon as I posted: use the option TickLabelFunction->TraditionalForm for the LinTicks. I'm wondering if that breaks anything else... anyone have any insight? Apr 10, 2012 at 2:42
• I can accept it only in 2 days apparently. Didn't know if it was ok to answer your own question... Apr 10, 2012 at 13:10
• Yes, it is OK in these cases. Apr 10, 2012 at 14:44

As soon as I posted, I realized I could check whether there were any options for LinTicks that might be useful:

Options@LinTicks // TableForm


Scanning that list, I saw:

TickLabelFunction -> Automatic


TickLabelFunction -> TraditionalForm

To the ticks definition from the question, and things worked: 