MathGroup Archive 2005

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

Search the Archive

Re: listplot two lists of different lengths

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59994] Re: [mg59989] listplot two lists of different lengths
  • From: "benshimo at bgumail.bgu.ac.il" <bsyehuda at gmail.com>
  • Date: Sun, 28 Aug 2005 03:07:32 -0400 (EDT)
  • References: <200508270811.EAA15275@smc.vnet.net>
  • Reply-to: benshimo at bgumail.bgu.ac.il
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,
First a small comment. I needn't use $DisplayFunction->Identity with
DisplayTogether. You need it for combinations of graphics with Show,
DisplayTogether and DisplayTogetherArray manage this automatically.
Now, for your problem, the "sterching" is actually displaying your (sorted)
random vercors on the same range on the horizontal axis. So, I'll do it
(sort and strech) together and put the results in new variables l11 and l22
so you can compare it later
<< Statistics`ContinuousDistributions`
<< Graphics`Graphics`
<< Graphics`Colors`

l1 = RandomArray[NormalDistribution[1, 0.5], 100];
l2 = RandomArray[NormalDistribution[1, 1], 200];
{l11, l22} = Thread[{Range[0, 1, 1/(Length[#] - 1)], Sort[#]}] & /@ {l1,l2};

DisplayTogether[ListPlot[l11, PlotStyle -> {PointSize[0.015], Red}, Frame ->
\
True, Axes -> False, PlotRange -> All], ListPlot[l22, PlotStyle -> \
{PointSize[0.015], Blue}, Frame -> True, Axes -> False, PlotRange -> All]]

good luck
yehuda

On 8/27/05, sean_incali <sean_incali at yahoo.com> wrote:
>
> let's say you have lists of different lengths
>
>
> << Statistics`ContinuousDistributions`
> << Graphics`Graphics`
> << Graphics`Colors`
>
> l1 = RandomArray[NormalDistribution[1, 0.5], 100];
> l2 = RandomArray[NormalDistribution[1, 1], 200];
>
> DisplayTogether[
> ListPlot[Sort@l1, PlotStyle -> {PointSize[0.015], Red}, DisplayFunction
> -> Identity, Frame -> True, Axes -> False, PlotRange -> All ],
> ListPlot[Sort@l2, PlotStyle -> {PointSize[0.015], Blue},
> DisplayFunction -> Identity, Frame -> True, Axes -> False],
>
> DisplayFunction -> $DisplayFunction]
>
> shows red is off to the left hand side because the list plotted in red
> is shorter inn length that one in blue.
>
> How do I stretch the scale for the list in red, so the plots are scaled
> to same axis? (taking half as many points for longer list doesn't work
> for me)
>
> the best way will be to stretch the red line...
>
> thanks for any inputs
>
> sean
>
>


  • Prev by Date: Re: listplot two lists of different lengths
  • Next by Date: Re: listplot two lists of different lengths
  • Previous by thread: Re: listplot two lists of different lengths
  • Next by thread: Re: listplot two lists of different lengths