RE: RE: [heur] Scientific Notation on Y-axis of ListPlots
- To: mathgroup at smc.vnet.net
- Subject: [mg68656] RE: [mg68624] RE: [heur] [mg68594] Scientific Notation on Y-axis of ListPlots
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 14 Aug 2006 06:44:41 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Instead of having exponents on every labeled tick mark why not scale the
data and y label.
data = Table[Random[Real, {-1.5/10^5, 5/10^6}], {20}];
data2 = Transpose[{Range[20], 10^6 data}];
Show[Graphics[
{AbsolutePointSize[4],
Point /@ data2}],
Frame -> True,
FrameLabel -> {x, SequenceForm[y, " × ", "10"^6]},
ImageSize -> 450];
Or if one wants less ragged tick labels on the left the CustomTicks command
from DrawGraphics could be used.
Needs["DrawGraphics`DrawingMaster`"]
leftticks =
CustomTicks[Identity, {-15, 5, 5, 5},
CTNumberFunction -> (NumberForm[#, {3, 1},
NumberPadding -> {"", "0"}] &)];
rightticks =
CustomTicks[Identity, {-15, 5, 5, 5}, CTNumberFunction -> ("" &)];
Draw2D[
{AbsolutePointSize[4],
Point /@ data2},
Frame -> True,
FrameLabel -> {x, SequenceForm[y, " × ", "10"^6]},
FrameTicks -> {Automatic, leftticks, Automatic, rightticks},
PlotRange -> {-15.2, 5.2},
PlotLabel -> "Simplified Tick Scale",
ImageSize -> 450];
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/
From: Jaccard Florian [mailto:Florian.Jaccard at he-arc.ch]
To: mathgroup at smc.vnet.net
Hello !
Yes, there is.
For example :
In[92]:=
data = Table[Random[Real, {-1.5/10^5, 5/10^6}], {20}]
In[93]:=
des = ListPlot[data];
In[94]:=
Clear[a, b, c, d]
In[95]:=
tic = (Ticks /. AbsoluteOptions[des])[[2]]
In[96]:=
tic2 = tic /. {(a_)?NumericQ, (b_)?NumericQ, c_, d_} ->
{a, ScientificForm[b], c, d};
In[97]:=
ListPlot[data, Ticks -> {Automatic, tic2}]
Regards
Florian Jaccard
florian.jaccard at he-arc.ch
-----Message d'origine-----
De : Joshua Feinberg [mailto:jfei05 at esc.cam.ac.uk]
Envoyé : vendredi, 11. août 2006 10:40
À : mathgroup at smc.vnet.net
Objet : [heur] [mg68594] Scientific Notation on Y-axis of ListPlots
Dear All,
I am plotting data points with y-values between -1.5x10^-5 and
5x10^-6. Mathematica labels the lowermost y-axis tick as "-0.000015"
and the uppermost y-axis tick at "5 x 10^-5". Is there any way to ask
Mathematica to label all of the y-axis ticks using only scientific
notation (rather than a mixture of scientific notation and decimal
form)?
Thanks in advance for any help you can offer.
Joshua Feinberg