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.
>