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

MathGroup Archive 2001

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

Search the Archive

Re: two y-axis

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27291] [mg27291] Re: [mg27288] two y-axis
  • From: BobHanlon at aol.com
  • Date: Sun, 18 Feb 2001 02:52:23 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Needs["Statistics`ContinuousDistributions`"];

dist = NormalDistribution[mu=Random[], sigma=Random[]];

Plot[{PDF[dist, x], CDF[dist, x]}, {x, mu-3sigma, mu+3sigma}];

scale = PDF[dist, mu];

Plot[{PDF[dist, x], scale*CDF[dist, x]}, {x, mu-3sigma, mu+3sigma}, 
    PlotStyle -> {RGBColor[0, 0, 1], RGBColor[1, 0, 0]}, 
    Frame -> True, Axes -> False, 
    FrameTicks -> {Automatic, Automatic, 
        Join[
          Table[{mu+k*sigma, 
              StringReplace[ToString[\[Mu]+k*\[Sigma]], " " -> ""], 
              {0.00625, 0.}, {AbsoluteThickness[0.25]}}, {k, -3, 3}], 
          Table[{mu+k*sigma, 
              "", {0.00375, 0.}, {AbsoluteThickness[0.125]}}, {k, -3, 3, 
              1/4}]], 
        Join[
          Table[{k*scale, k, {0.00625, 0.}, {AbsoluteThickness[0.25]}}, {k, 
              0, 1, 0.2}], 
          Table[{k*scale, "", {0.00375, 0.}, {AbsoluteThickness[0.125]}}, {k, 
              0, 1, 0.05}]]}, 
    FrameLabel -> {
        StyleForm["\nx", FontWeight -> "Bold", FontSize -> 12], 
        StyleForm["PDF\n", FontWeight -> "Bold", 
          FontColor -> RGBColor[0, 0, 1], FontSize -> 12], 
        StyleForm["Normal Distribution\n", FontWeight -> "Bold", 
          FontSize -> 14], 
        StyleForm["\nCDF", FontWeight -> "Bold", 
          FontColor -> RGBColor[1, 0, 0], FontSize -> 12]}, 
    ImageSize -> {500, 310}];

Bob Hanlon

In a message dated 2001/2/16 4:07:00 AM, bernd at bio.vu.nl writes:

>Does anyone have code or know how to plot two functions in Mathematica,
>each on
>a different y-axis. I haven't found whether it is possible to use to
>y-axes in Plot. 
>


  • Prev by Date: Re: Arrows on axes?
  • Next by Date: Re: Questions
  • Previous by thread: Re: two y-axis
  • Next by thread: Re: two y-axis