Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1717

Coloring a ListSurfacePlot3D with a n x 4 matrix

From David Kahle <david.kahle@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Coloring a ListSurfacePlot3D with a n x 4 matrix
Date 2011-04-16 11:35 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iobuuc$bdr$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Coloring a ListSurfacePlot3D with a n x 4 matrix David Kahle <david.kahle@gmail.com> - 2011-04-16 11:35 +0000

csiph-web