Re: ListLogLinearPlot with two y-axis
- To: mathgroup at smc.vnet.net
- Subject: [mg102599] Re: ListLogLinearPlot with two y-axis
- From: pasQualle <pschulthess at googlemail.com>
- Date: Sun, 16 Aug 2009 06:41:09 -0400 (EDT)
- References: <h63cf6$19s$1@smc.vnet.net> <h65vei$ep7$1@smc.vnet.net>
On Aug 15, 11:34 am, Harutyun <amirjan... at gmail.com> wrote:
> if you like overall appearance of your solution you should only
> change
>
> ListLinePlot to ListLogLinearPlot
>
> TwoAxisListPlot[f_List, g_List, frange_, grange_, color1_, color2_,
> opts___?OptionQ] :=
> Module[{old, new, scale, fm, fM, gm, gM, newg}, {fm, fM} = frange;
> {gm, gM} = grange;
> scale[var_] := ((var - gm) (fM - fm))/(gM - gm) + fm;
> old = AbsoluteOptions[
> ListPlot[g, Frame -> True, PlotRange -> grange,
> DisplayFunction -> Identity], FrameTicks][[1, 2, 2]];
> new = (Prepend[Rest[#1], scale[First[#1]]] &) /@ old;
> newg = Transpose[{Transpose[g][[1]],
> Map[scale, Transpose[g][[2]], {1, 2}]}];
> ListLogLinearPlot[{f, newg}, Frame -> True,
> FrameTicks -> {Automatic, Automatic, None, new},
> PlotStyle -> {{color1}, {color2}},
> FrameStyle -> {{}, {color1}, {}, {color2}},
> PlotRange -> frange*(1 + .00 (fM - fm)), opts]]
Thanks Harutyun,
this is the perfect easy solution I searchd for.