Re: plot on condition

*To*: mathgroup at smc.vnet.net*Subject*: [mg56226] Re: [mg56218] plot on condition*From*: yehuda ben-shimol <bsyehuda at gmail.com>*Date*: Wed, 20 Apr 2005 05:29:56 -0400 (EDT)*References*: <200504190855.EAA02625@smc.vnet.net>*Reply-to*: yehuda ben-shimol <bsyehuda at gmail.com>*Sender*: owner-wri-mathgroup at wolfram.com

I'm not sure if you can do it directly under ListPlot, but with combination graphics primitives and some basic programming IT IS POSSIBLE 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 yehuda > 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 > >