MathGroup Archive 2005

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

Search the Archive

Re: plot on condition

  • To: mathgroup at
  • Subject: [mg56226] Re: [mg56218] plot on condition
  • From: yehuda ben-shimol <bsyehuda at>
  • Date: Wed, 20 Apr 2005 05:29:56 -0400 (EDT)
  • References: <>
  • Reply-to: yehuda ben-shimol <bsyehuda at>
  • Sender: owner-wri-mathgroup at

I'm not sure if you can do it directly under ListPlot, but with
combination graphics primitives and some basic programming IT IS
the following will do 
Graphics[{PointSize[0.05], {If[Last[#] == 3, Green, 
      Red], Point[First[#]]} & /@ Thread[{pnts, cnd}]}, Axes -> True,
             PlotRange -> All] // Show
This may also be generated as a function that take the data and
conditions as arguments
> hello
> my question about plotting a list of points but with some condition depends on
> the status of points in other list;
> pnts={{1,2},{5,4},{3,2},{2,6},{5,3}};
> cnd={7,3,5,8,3};
> the condition is: plot a point in list "pnts" in Blue if the corresponding
> element in list "cnd" is 3 else plot in Green
> regards

  • Prev by Date: Re: plot on condition
  • Next by Date: Re: match 1, replace 2
  • Previous by thread: Re: plot on condition
  • Next by thread: Re: plot on condition