3D Plot of frequency data
- To: mathgroup at smc.vnet.net
- Subject: [mg62637] 3D Plot of frequency data
- From: leigh pascoe <leigh at cephb.fr>
- Date: Wed, 30 Nov 2005 00:06:17 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Dear Mathgroup, I would like to do a 3D plot of several functions where the coordinates (x, y,z) are subject to the restrictions x>=0 y>=0 z>=0 x+y+z<=1 These restrictions arise naturally when considering the frequencies of four types in a population. The fourth frequency, subject to similar restrictions, is just 1-x-y-z. I believe this range of possible values defines a tetrahedron with vertices (0,0,0),(1,0,0), (0,1,0),(0,0,1) that could be drawn using the code recently posted by David Park. i.e. v1 = {0, 0, 0}; v2 = {1, 0, 0}; v3 = {0, 1, 0}; v4 = {0, 0, 1}; tetrahedron[{v1_, v2_, v3_, v4_}] := {Polygon[{v1, v2, v3}], Polygon[{v1, v2, v4}], Polygon[{v1, v4, v3}], Polygon[{v4, v2, v3}]}; Show[Graphics3D[tetrahedron[{v1, v2, v3, v4}]]]; If possible (for symmetry) I would like to apply a shear function (say to the y and z directions) so that the resulting tetrahedron would be regular. A point (x1,x2,x3) could then be plotted by measuring along each of the sides of the tetrahedron corresponding to the original axes and finding the intersection point of the perpendiculars. I imagine a transformation can be defined to convert the (x1,x2,x3) or (x',y',z') coordinates to the orthogonal (x,y,z) system if this is necessary. Now to the functions. As first step I would like to plot within this regular tetrahedron the implicit function x2 x3-x1(1-x1-x2-x3)=0 This is a twisted surface that would have edges corresponding to the axes x'=y'=0 (z' axis) and x'=z'=0 (y' axis) and the tetrahedral sides defined by 1-x'-y'-z'=0=y' and 1-x'-y'-z'=0=z' For easy visualisation the tetrahedron should be a wireframe and the function surface should be shown as a grid mesh. I would then like to add some individual points, both on and off the surface and ultimately some trajectories (lines) defined by a series of points. The ability to visualise points and functions in this manner would be very useful when considering problems related to frequency data. Can anyone help me to do this in Mathematica? Thanks Leigh