Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to plot some data using the LevelScheme package, but changing the logarithmic scale to display values in NumberForm instead of ScientificForm. I.e. I want to see the axes displaying values as 1, 10, 100 and 1000 instead of 10^0, 10^1 etc. Do you have any tips on how I can achieve this?

I was trying to play with TickLabelFunction but I guess this is not meant to be used as I want.

Here's a minimal working example:

randomdata = Sort@Transpose@{
   Log[10, RandomReal[{1*^-7, 1*^-5}, 1000]],
   Log[10, RandomReal[{0.1, 1000}, 1000]]
};

ListPlot[randomdata, PlotRange -> {{-7, -5}, {-1, 3}}, Joined -> False,
 Axes -> False, Frame -> {{True, False}, {True, False}}, 
 FrameStyle -> {{Automatic, None}, {Automatic, None}},
 FrameTicks -> {{LogTicks[10, -1, 3,TickLabelFunction -> (ScientificForm[#] &)],None}, 
                {LogTicks[10, -7, -5], None}}
];

enter image description here

(Interestingly, this pseudo-data is not so randomly distributed at all ;) edit: nevermind, I didn't remember the data was in logspace)

share|improve this question
    
Have you tried AccountingForm in place of ScientificForm? –  bill s Jun 5 '13 at 11:04
    
Yes, doesn't work either –  Sosi Jun 5 '13 at 11:09
1  
It is randomly distributed, just Log isn't. –  Kuba Jun 5 '13 at 11:53
    
When I look at the data generated for the above plot, it has points at places like {-6.96923, 2.56757}, {-6.96601, 1.27653}. How can these points be plotted in a log axis where the numbers (from 10^-7 to 10^-5) are all positive? –  bill s Jun 5 '13 at 12:06
    
@bills I'm not sure I am understanding your question. Those numbers are the base 10 logarithm of the original number. I.e. {-6.96923, 2.56757} correspond to {x,y}={10^-6.96601, 10^1.27653}. None of them are negative. What the package LevelScheme does is to make this correspondence –  Sosi Jun 5 '13 at 12:38
show 1 more comment

2 Answers

up vote 1 down vote accepted

here is a little hack to post-process the FrameTicks as provided by LevelScheme:

cleanTicks=Rule[FrameTicks, List[List[a_, None], List[b_, None]]] :> Rule[FrameTicks, 
   List[List[a /. DisplayForm[SuperscriptBox[x_, y_]] :> 
              AccountingForm[Power[x, y]], None], List[b, None]
            ]
        ] 

ListPlot[randomdata, PlotRange -> {{-7, -5}, {-1, 3}}, 
         Joined -> False, Axes -> False, 
         Frame -> {{True, False}, {True, False}}, 
         FrameStyle -> {{Automatic, None}, {Automatic, None}},
         FrameTicks -> {
         {LogTicks[10, -1, 3, TickLabelFunction -> (AccountingForm[#] &)],
          None},
         {LogTicks[10, -7, -5], None}}] /. cleanTicks /. Rational[a_, b_] :> N[a/b]

enter image description here

The /. Rational[a_, b_] :> N[a/b] cleans up any ratios invented by the AccountingForm.

share|improve this answer
add comment

This isn't exactly what you want, but you can get close using

ListLogLogPlot[10^randomdata, 
   Ticks -> {{0.0000001, 0.000001, 0.00001}, {1, 10, 100, 1000}}]

enter image description here

Here I"m using the built in ListLogLogPlot rather than the LevelScheme package - that's why I'm plotting 10^randomdata so that it plots the same data.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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