Re: double labelled y axis in graphs
- To: mathgroup at smc.vnet.net
- Subject: [mg21246] Re: [mg21218] double labelled y axis in graphs
- From: Hartmut Wolf <hwolf at debis.com>
- Date: Mon, 20 Dec 1999 02:28:07 -0500 (EST)
- Organization: debis Systemhaus
- References: <199912170629.BAA02183@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Pyrtr schrieb:
>
> Does anyone know of a way to put 2 y axes on 1 graph. I need to present data
> on the y axis and refer to it with 2 equivalent scales.. i.e. degrees F and
> degrees C for example.
>
> I could have 2 y axes .. 1 on each side of the graph labelled appropriately,
> or have 2 scales on a single y axis on the left side of the graph.
>
> Thanks
>
> Charles A. Judge M.D.
Hello Charles,
This is a simulation of a fever curve (in centigrades):
temp = Join[Table[Random[Real] + 37.25, {4}],
Table[6x/E^x + Random[Real] + 37.25, {x, 0, 6, 0.2}]];
Plot it, but don't display to get the centigrade scale.
g = ListPlot[temp, PlotJoined -> True, PlotRange -> All, Frame -> True,
Axes -> None, FrameTicks -> {Automatic, Automatic, None, None},
DisplayFunction -> Identity];
<< Miscellaneous`Units`
Extract the Centigrade scale and convert it to Fahrenheit, keeping the
Centigrade labels:
ft = {ConvertTemperature[#1, Centigrade, Fahrenheit],
If[#2 == "", #2, #1], #3, #4} & @@@ FullOptions[g,
FrameTicks][[2]];
Convert the fever curve to Fahrenheit:
tempf = ConvertTemperature[#, Centigrade, Fahrenheit] & /@ temp;
Plot this with Fahrenheit scale at left, and Centigrades at right:
gf = ListPlot[tempf, PlotJoined -> True, PlotRange -> All, Frame ->
True,
Axes -> None, FrameTicks -> {Automatic, Automatic, None, ft},
FrameLabel -> {None, "Fahrenheit", None, "Centigrade"}]
Kind regards,
Hartmut
- References:
- double labelled y axis in graphs
- From: "Pyrtr" <nospamme@nonet.net>
- double labelled y axis in graphs