MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ListLogLinearPlot with two y-axis

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102582] Re: ListLogLinearPlot with two y-axis
  • From: Harutyun <amirjanyan at gmail.com>
  • Date: Sat, 15 Aug 2009 05:34:14 -0400 (EDT)
  • References: <h63cf6$19s$1@smc.vnet.net>

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




  • Prev by Date: Matrices with square brackets
  • Next by Date: Re: Select text with keyboard?
  • Previous by thread: ListLogLinearPlot with two y-axis
  • Next by thread: Re: ListLogLinearPlot with two y-axis