Re: plot on condition
- To: mathgroup at smc.vnet.net
- Subject: [mg56243] Re: [mg56218] plot on condition
- From: "David Park" <djmp at earthlink.net>
- Date: Wed, 20 Apr 2005 05:30:28 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Needs["Graphics`Colors`"] pnts = {{1, 2}, {5, 4}, {3, 2}, {2, 6}, {5, 3}}; cnd = {7, 3, 5, 8, 3}; plotpoints = MapThread[{If[#2 == 3, Blue, Green], Point[#1]} &, {pnts, cnd}] Show[Graphics[ {AbsolutePointSize[5], plotpoints}], Axes -> True, PlotRange -> {{0, 6}, {0, 7}}, ImageSize -> 400, Background -> Linen]; David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ 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