Re: Axis label for StackGraphics
- To: mathgroup at smc.vnet.net
- Subject: [mg26061] Re: [mg26047] Axis label for StackGraphics
- From: BobHanlon at aol.com
- Date: Wed, 22 Nov 2000 01:55:51 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 11/18/00 11:40:10 PM, pmhowe at lanl.gov writes: >Sometimes, I find it very useful to use StackGraphics to make plots >to visualize parameter effects. A trivial example results from the >following: > ><< Graphics`Graphics3D`; > >Clear[k]; >funct[k_] := Module[{eqtn}, > eqtn = Exp[ 1 - (x - k)/x] ; > Plot[eqtn, {x, 1., 2 Pi}, PlotRange -> All, > DisplayFunction -> Identity]]; > >tab1 = Table[funct[k], {k, 1, 10}]; > >Show[StackGraphics[tab1], DisplayFunction -> $DisplayFunction]; > > >I would like to have the values of k included in the plot, along the >third axis, to identify each curve. If I change the option Axes -> >{True, False, True} to Axes -> {True,True, True}, I can get numbers >on the third axis, but they don't correspond to the values of k. >Also, for clarity, I may often want the k-values plotted along the >lower right axis. Any suggestions? > Needs["Graphics`Graphics3D`"]; n = 10; hueOffset = 0.5; funct[k_] := Module[{eqtn}, eqtn = Exp[ k/x] ; Plot[eqtn, {x, 1, 4}, PlotRange -> All, PlotStyle -> Hue[(k + hueOffset)/(n + hueOffset)], DisplayFunction -> Identity]]; tab1 = Table[funct[k], {k, n}]; Show[StackGraphics[tab1], DisplayFunction -> $DisplayFunction, Axes -> {True, True, True}, Ticks -> {Automatic, Table[{k/n, StyleForm[k, FontColor -> Hue[(k + hueOffset)/(n + hueOffset)]]}, {k, n}], Automatic}]; Show[StackGraphics[tab1], DisplayFunction -> $DisplayFunction, Axes -> {True, True, True}, Ticks -> {Automatic, Table[{k/n, StyleForm[k, FontColor -> Hue[(k + hueOffset)/(n + hueOffset)]]}, {k, n}], Automatic}]; Show[StackGraphics[Flatten[ {tab1, Graphics[Table[ Text[StyleForm[" " <> ToString[k], FontColor -> Hue[(k + hueOffset)/(n + hueOffset)]], {4, .9k/n, 0}, {0, 1}], {k, n}]]}]], DisplayFunction -> $DisplayFunction]; Plot3D[Exp[ k/x], {x, 1, 4}, {k, 0, n}, PlotRange -> {0, 700}]; Needs["Graphics`Legend`"]; Plot[Evaluate[Table[Exp[ k/x], {k, n}]], {x, 1, 2Pi}, PlotStyle -> Table[Hue[(k + hueOffset)/(n + hueOffset)], {k, n}], PlotLegend -> Table[StyleForm[k, FontColor -> Hue[(k + hueOffset)/(n + hueOffset)]], {k, n}], LegendPosition -> {.6, -.3}, LegendLabel -> "k =", PlotRange -> {{1, 4}, Automatic}]; Bob Hanlon