Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Help in changing the vertical axis tick label format

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76403] Re: Help in changing the vertical axis tick label format
  • From: siewsk at bp.com
  • Date: Mon, 21 May 2007 06:06:32 -0400 (EDT)
  • References: <f2mcmh$kbu$1@smc.vnet.net>

Thanks everyone,

  This is what I used now.

SciPlot2D[dp,fp,opt]
plots  a 2D graph with Scientific Notation on the Vertical Axis. The
options are
dp     The total number of decimal places. Must be greater than fp
fp     The number of decimal places to the right of the decimal point.
opt   The normal options for Plot[ ] function.

In[1]:=
SciPlot2D[dp_, fp_, opt__] := Module[{plot1, yTicks},
   plot1 = Plot[opt, DisplayFunction -> Identity];
    yTicks = (Ticks /. AbsoluteOptions[plot1, Ticks])[[2]] /.
      {(y_)?NumericQ, (yLabel_)?NumericQ, {rr_, ll_}, r__} :>
       {y, ScientificForm[yLabel, {dp, fp}, NumberPadding -> {"",
"0"}], {rr, rr},
        r}; Show[plot1, Ticks -> {Automatic, yTicks}, DisplayFunction -
>
      $DisplayFunction]]

In[2]:=
SciPlot2D[2, 1, x^3 - 6*x - 12, {x, -10, 10}, ImageSize -> {500,
400},
   AspectRatio -> 4/5, PlotStyle -> {RGBColor[0., 0., 1],
Thickness[0.001]}];



  • Prev by Date: Re: TeXForm and custom LaTeX macros
  • Next by Date: Image rotation?
  • Previous by thread: Re: Help in changing the vertical axis tick label format
  • Next by thread: A harmless and amusing bug