5

I am wondering if there is a way to use custom ticks on FrameTicks but keep the tick "line marks" for the LogLog plot or LogLinear plot. This is the original plot: enter image description here

I want to switch the tick into the following, but keep the tick "line marks" for the log axis. Here the tick "line marks" disappear. enter image description here

The following code is used:

plist = Table[RandomReal[{0, 10000}], 100];
myTicks = Table[{10^i, Superscript[10, i]}, {i, -20, 15}];

(* without ticks *) ListLogLogPlot[plist, Frame -> True, PlotRange -> {All, All}, PlotStyle -> {Thick, Black}, PlotMarkers -> [EmptyCircle] ]

(* with ticks *) ListLogLogPlot[plist, Frame -> True, PlotRange -> {All, All}, PlotStyle -> {Thick, Black}, PlotMarkers -> [EmptyCircle], FrameTicks -> {{myTicks, None},{myTicks, None}} ]

fdjutant
  • 105
  • 5

1 Answers1

7

The list of tick marks can be in any order, so all we need to do is append the unlabeled tick marks to the existing list.

labeledTicks = Table[{10^i, Superscript[10, i]}, {i, -20, 15}];

The unlabeled ticks can be generated by multiplying each of the labeled ones by the integers 2 through 9. Strictly speaking, the unlabeled ones have Null as their labels.

unlabeledTicks = Flatten[Table[{k*j, Null}, 
                     {k, 2, 9}, {j, labeledTicks[[All, 1]]}], 1];

Then

myTicks = Join[labeledTicks, unlabeledTicks];

(with ticks) ListLogLogPlot[plist, Frame -> True, PlotRange -> {All, All}, PlotStyle -> {Thick, Black}, PlotMarkers -> [EmptyCircle], FrameTicks -> {{myTicks, None}, {myTicks, None}}]

enter image description here

LouisB
  • 12,528
  • 1
  • 21
  • 31