MathGroup Archive 2011

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

Search the Archive

Coloring a ListSurfacePlot3D with a n x 4 matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118202] Coloring a ListSurfacePlot3D with a n x 4 matrix
  • From: David Kahle <david.kahle at gmail.com>
  • Date: Sat, 16 Apr 2011 07:34:54 -0400 (EDT)

Hi all -

I have a matrix whose rows, 4 dimensional vectors, represent (x, y, z)  
values as well as a measurement f which I would like to use to create  
an interpolated surface colored according to the value of f.   
ListSurfacePlot3D gives me the appropriate surface (when I strain out  
the x, y, z values), but I'm having a hard time coloring it.  I've  
tried basic stuff with ColorFunction to no avail, but I'm sure this is  
a simple task.  Ideas?  Small example below.


Points = Flatten[
    Table[{x, y, 1 - x - y, (x - 1/2)^2 + (y - 1/2)^2}, {x, 0, 1,  
1/4}, {y, 0,
      1, 1/4}], 1];
N[Points[[1 ;; 5]]]

Knots = Map[Take[#, {1, 3}] &, Points];
N[Knots[[1 ;; 5]]]

ListSurfacePlot3D[Knots] (* Works fine, how to I color the surface? *)

Colorf = Function[{x, y, z},  ColorData["GreenBrownTerrain"][
     Points[[ Position[Knots, {x, y, z}][[1]] ]][[1]][[4]]
]];
ListSurfacePlot3D[Knots, ColorFunction -> Colorf]


Many thanks
david.

----------------------------------
----------------------------------
David Kahle
Rice University
Rm. 1041 Duncan Hall
Department of Statistics, MS 138
6100 Main St.
Houston, TX 77005
http://sites.google.com/site/davidkahle


  • Prev by Date: Re: broadcasting of Equal ? (newbie question)
  • Next by Date: Re: Rotated text not appearing in a Plot
  • Previous by thread: How to define FrontEndEventActions for keyboard combinations with Shift and Alt?
  • Next by thread: Re: Coloring a ListSurfacePlot3D with a n x 4 matrix