I want to express the ticks in scientific form. I tried two ways as following
ListLogPlot[Table[{x, 10^x}, {x, -1, 1}], Ticks -> {Automatic, {10^-1, 10^0, 10^1}}]
ListLogPlot[Table[{x, 10^x}, {x, -1, 1}],
Ticks -> {Automatic, ScientificForm[{10^-1, 10^0, 10^1}]}]
but they just could not work as you can see; the latter even is wrong.
Why & how?
Edit by @belisarius
Scientific Notation is usually understood as ${1.\times 10^{-2}}$, however the OP wants just ${10^{-2}}$. Solutions for both cases can be found in the answers below.
Answer
Here's one possibility. In this case, Superscript
provides the needed format of exponents but Table
helps in formatting Ticks
over sets of values.
ListLogPlot[Table[PartitionsQ[n], {n, 50}],
Ticks -> {Automatic, Table[{10^k, Superscript[10, k]}, {k, -2, 5}]},
PlotRange -> {Automatic, {1/1000, 10^5}}]
Comments
Post a Comment