RE: help on color function!
- To: mathgroup at smc.vnet.net
- Subject: [mg41902] RE: [mg41882] help on color function!
- From: "David Park" <djmp at earthlink.net>
- Date: Mon, 9 Jun 2003 05:20:49 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Sabrina, It may be tricky to design a color function that encodes the information you want and which is easy for the viewer to "read out". In your initial code you were not supplying a new color to each point. But something like the following may work. displayPoint[p_] := {RGBColor @@ (p/Sqrt[p . p]), Point[p]} Show[Graphics3D[ {AbsolutePointSize[4], displayPoint /@ list1}], PlotRange -> {{0, 10}, {0, 10}, {0, 0.15}}, Background -> Linen, PlotLabel -> "Equilibria with Different S", Axes -> True, AxesLabel -> {"M", "P", "S"}, AxesStyle -> { Gray}, BoxStyle -> {Gray}, BoxRatios -> {1, 1, 0.5}, ViewPoint -> {1.300, -2.400, 2.000}, ImageSize -> 400]; Or maybe something like this... displayPoint2[p_] := {Hue[Part[p, 2]/10], Point[p]} Show[Graphics3D[ {AbsolutePointSize[4], displayPoint2 /@ list1}], PlotRange -> {{0, 10}, {0, 10}, {0, 0.15}}, Background -> Linen, PlotLabel -> "Equilibria with Different S", Axes -> True, AxesLabel -> {"M", "P", "S"}, AxesStyle -> { Gray}, BoxStyle -> {Gray}, BoxRatios -> {1, 1, 0.5}, ViewPoint -> {1.300, -2.400, 2.000}, ImageSize -> 400]; You have to make certain that all the entries in RGBColor, or in Hue, are between 0 and 1. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ -----Original Message----- From: sabrina [mailto:mystery at newbie.com] To: mathgroup at smc.vnet.net Subject: [mg41902] [mg41882] help on color function! Hello, all I wonder if there is an easy way to define a color function based on a set of values: For example , I have the following list: list1= {{0.0178532,0.982147,0.01},{0.0270235,1.47298,0.015},{0.0363674,1.96363, 0.02},{1.57286,0.927138,0.025},{1.28258,1.21742,0.025},{0.0458944,2.45411, 0.025},{1.96464,1.03536,0.03},{1.22019,1.77981,0.03},{0.0556147,2.94439, 0.03},{2.32115,1.17885,0.035},{1.19285,2.30715,0.035},{0.0655396,3.43446, 0.035},{2.67003,1.32997,0.04},{1.17293,2.82707,0.04},{0.0756814,3.92432, 0.04},{3.01582,1.48418,0.045},{1.15586,3.34414,0.045},{0.0860538,4.41395, 0.045},{3.36004,1.63996,0.05},{1.14012,3.85988,0.05},{0.0966719,4.90333, 0.05},{3.70335,1.79665,0.055},{1.12503,4.37497,0.055},{0.107553,5.39245, 0.055},{4.04607,1.95393,0.06},{1.11025,4.88975,0.06},{0.118715,5.88128, 0.06},{4.38841,2.11159,0.065},{1.09554,5.40446,0.065},{0.130181,6.36982, 0.065},{4.73046,2.26954,0.07},{1.08079,5.91921,0.07},{0.141973,6.85803, 0.07},{5.07232,2.42768,0.075},{1.06589,6.43411,0.075},{0.15412,7.34588, 0.075},{5.41402,2.58598,0.08},{1.05076,6.94924,0.08},{0.166654,7.83335, 0.08},{5.7556,2.7444,0.085},{1.03532,7.46468,0.085},{0.17961,8.32039, 0.085},{6.09709,2.90291,0.09},{1.01951,7.98049,0.09},{0.193032,8.80697, 0.09},{6.4385,3.0615,0.095},{1.00325,8.49675,0.095},{0.20697,9.29303, 0.095},{6.77985,3.22015,0.1},{0.986488,9.01351,0.1},{0.221485,9.77851, 0.1}}; I used the following code to plot this list: In[150]:= Needs["Graphics`Colors`"]; dots=Show[Graphics3D[ {Hue[h]/.h-> list1[[All,3]], AbsolutePointSize[4], Point /@ list1}], PlotRange -> {{0, 10}, {0, 10}, {0,0.15}}, Background -> Linen, PlotLabel-> "Equilibria with Different S", Axes-> True,AxesLabel\[Rule]{"M","P","S"},AxesStyle->{ Gray}, BoxStyle ->{Gray},BoxRatios-> {1,1,0.5}, ViewPoint->{1.300, -2.400, 2.000}, ImageSize-> 400]; What I was trying to do it to show different point with different colors if list1[[All,3]] is different. But I could not get the right answer that I want. Would anybody help me out? Thanks a lot Sabrina