Re: plot on condition
- To: mathgroup at smc.vnet.net
- Subject: [mg56251] Re: plot on condition
- From: dh <dh at metrohm.ch>
- Date: Wed, 20 Apr 2005 05:31:05 -0400 (EDT)
- References: <d42lcj$3lb$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
As far as I know, ListPlot can only deal with one set of PlotStyles (one color) at a time. You can still use ListPlot to plot the axes, but you then plot the points again in a Epilog with the needed colors. E.g. ListPlot[pnts, Epilog -> {PointSize[0.05], MapThread[({If[#1 == 3, Blue, Red], Point[#2]}) &, {cnd, pnts} ]}] Sincerily, Daniel > 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 >