0
$\begingroup$

I have a ListLinePlot with a logarithmic x-axis. I want the FrameTicks to be in scientific form i.e. 10^n.

The code is as follows:

fRD2ticks = {{Automatic, 
    Automatic}, {Charting`ScaledTicks[{Log, Exp}], 
    Charting`ScaledFrameTicks[{Log, Exp}]}};

data = {{0.00216864`, 3}, {0.00121986`, 4}, {0.000780711`, 
    5}, {0.00054216`, 6}, {0.0003984`, 7}, {0.000305`, 8}, {0.000241`,
     9}, {0.0001952`, 10}, {0.00016138`, 11}, {0.00013554`, 
    12}, {0.00011549`, 13}, {0.00009959`, 14}, {0.00008676`, 
    15}, {0.000048795`, 20}, {0.000031229`, 25}, {0.00002169`, 
    30}, {0.00001594`, 35}, {0.000012199`, 40}, {0.00001`, 44.179`}};

ListLinePlot[data,
 Frame -> True,
 InterpolationOrder -> 2,
 FrameTicks -> fRD2ticks,
 FrameLabel -> {"Target Radius (m)", "Initial SMA (au)"},
 LabelStyle -> {FontFamily -> "Baskerville", FontSize -> 12, Bold},
 FrameStyle -> Directive[Thick, Black], ImageSize -> Medium,
 PlotRange -> {-2, 46},
 ScalingFunctions -> {"Log", None},
 PlotRange -> Automatic]

Note that the data the plot uses is imported, hence I can't show an image of the plot.

One method which I tried involved manually defining ticks as:

testticks = Table[{10^i, Superscript[10, i]}, {i, -5, 2}]; 

and including this in FrameTicks, however this doesn't work.

Any suggestions would be appreciated.

$\endgroup$
5
  • $\begingroup$ Instead of FrameTicks -> fRD2ticks use FrameTicks -> {{fRD2ticks,fRD2ticks},Automatic} $\endgroup$
    – Ben Izd
    Mar 9 at 19:42
  • $\begingroup$ @BenyIzd That doesn't work. $\endgroup$
    – testing09
    Mar 9 at 19:47
  • $\begingroup$ Please remove all the formatting code about fonts etc, and instead add some data (could be made up data) so we can reproduce what you see. $\endgroup$
    – MarcoB
    Mar 9 at 21:56
  • $\begingroup$ @MarcoB I've edited the code. $\endgroup$
    – testing09
    Mar 10 at 10:06
  • $\begingroup$ Take a look at: Forcing scientific ticks, How to express ticks in scientific form?, About the number format in ticks. $\endgroup$
    – MarcoB
    Mar 10 at 13:09

Browse other questions tagged or ask your own question.