two y-axes in one plot
- To: mathgroup at smc.vnet.net
- Subject: [mg8040] two y-axes in one plot
- From: Buttgereit <Buttgereit at compuserve.com>
- Date: Sat, 2 Aug 1997 22:32:48 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
an example:
Plot[
{
Sin[x],
.5 2 Cos[x]
}, {x,0,2 Pi},
Frame->{True,True,False,True},
FrameTicks->{
Automatic,
{{-1,"-1"},{0,"0"},{1,"1"}},
False,
{{1,"2"},{.5,"1"},{0,"0"},{-.5,"1"},{1,"2"}}
}
]
1. Map one y-range into the other; here I have mapped the range {-2,2} of=
the function 2 Cos[x] into the range {-1,1} of Sin[x] - so both functions=
will use all available space to be displayed (or use an other map to have=
a
certain scale).
2. use different FrameTicks for different axes.
Tom Wickham-Jones has defined a couple of functions for labeling ticks.
They are described and explained in his book "Mathematica Graphics"
(Springer, '94) - it might already be available on MathSource
(EnhancedGraphics or something like that).
If you use Graphics`MultipleListPlot` you will easily be able to use
different styles for your two functions...
Greetings,
Peter