2
$\begingroup$

I'm having an issue with Mathematica wherein, when trying to use ListLogPlot, the scale of the y-axis skips entire decades. Instead of 1, 10, 100, 1000, it goes more like 10^2,10^4,10^6,10^8. I need it to, well, not do this.

This is more or less my code, with different numbers introduced (although same order of magnitude)

data1 = {{{1, 1.432*10^8}, {2, 4.2*10^7}, {5., 1.68*10^7}, {7., 
   5.21*10^6}, {10., 1.02*10^6}, {12., 5.37*10^5.}, {15., 1.76*10^5.}, {17., 
   1.40*10^5.}, {20., 7.87*10^4}}}

Then

ListLogPlot[data1, Joined -> True, PlotMarkers -> {Automatic, Tiny}, 
 PlotStyle -> Red, PlotRange -> {{0, 20}, {1, 1000000000}}, 
 AspectRatio -> 1, Frame -> True]

And, at least for mine, it produces a graph wherein the ticks on the vertical log axis skip decades.

There should also be a large white blank space towards the bottom of the graph. This is intentional, as I have several other sets of data I need to include using the Show function, and Show seems to default to the first graph set. So if I can get this graph to work, then it should be pretty easy to graph the others, and use the Show function.

Any help is greatly appreciated.

$\endgroup$
4
$\begingroup$

you need to manually specify FrameTicks to override the default.

 ListLogPlot[data1, Joined -> True, PlotMarkers -> {Automatic, Tiny}, 
    PlotStyle -> Red, PlotRange -> {{0, 20}, {1, 1000000000}}, 
    AspectRatio -> 1, Frame -> True, 
    FrameTicks -> {Automatic, 
        Table[{10^i, Superscript[10, i] }, {i, 0, 10}], None, None}]

enter image description here

adding the sub ticks..

 ListLogPlot[data1, Joined -> True, PlotMarkers -> {Automatic, Tiny}, 
    PlotStyle -> Red, PlotRange -> {{0, 20}, {1, 1000000000}}, 
     AspectRatio -> 1, Frame -> True, FrameTicks -> {Automatic,
      Table[{10^i,
         Superscript[10, i], {.02, 0}}, {i, 0, 10}]~Join~
          Flatten[ Table[{j 10^i, , {.005, 0}}, {i, 0, 10}, {j, 2, 9 }], 1],
              None, None}]

enter image description here

$\endgroup$
  • $\begingroup$ Thank you. This fixed the problem! One last question, however: Can I remove the 1's from the 1x10^n and just have 10^n? $\endgroup$ – QuantumCakes May 22 '14 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.