1
$\begingroup$

Not as exciting as the buttocks question, but ...

For some list log plots, it is faster to calculate for certain log values. eg:

ListPlot[Table[Prime[n],{n,Table[10^j, {j, 1, 12}]}]

Is it possible to get these x-axis values to show up on the ticks?

$\endgroup$

2 Answers 2

3
$\begingroup$
 v = Table[Prime[n], {n, Table[10^j, {j, 1, 12}]}]
 np = Table[{j, Rotate[Text[10^j], Pi/3]}, {j, 1, 12}];
 ListLogPlot[v, Ticks -> {np, Automatic}]

enter image description here

or try

 np = Table[{j, Text["10^" <> ToString[j]]}, {j, 1, 12}];
$\endgroup$
0
1
$\begingroup$

I'm not sure I understand your question, because you are asking about a log plot, but you aren't using ListLogPlot at all. Perhaps this is what you want?

ListLogPlot[Table[{10^j, Prime[10^j]}, {j, 1, 12}]]

Or even:

ListLogPlot[Table[{10^j, Prime[10^j]}, {j, 1, 12}], 
 Ticks -> {Table[10^j, {j, 1, 12}], Automatic}]

The latter sounds... maybe like what you want, but it can't be, because it produces a terrible looking x-axis.

$\endgroup$
3
  • $\begingroup$ not quite, I would like the ticks spaced evenly, but I don't know whether this is possible. $\endgroup$
    – martin
    Nov 25, 2014 at 18:24
  • $\begingroup$ ie plotted as ListPlot, but with ticks at values specified. $\endgroup$
    – martin
    Nov 25, 2014 at 18:26
  • $\begingroup$ Does my first answer not do that? Or how about any variation of the second where the Table[10^j...] is replaced with something evenly spaced? $\endgroup$ Nov 25, 2014 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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