From: Pasha Karami on 3 Oct 2009 09:05 Dear all, I would like to plot 3D and contour plot of a list of data together(in one plot) in Mathematica6. I know in Mathematica 5.2 with ListShadowPlot3D we could plot what i need. However,Mathematica6 does not have this command and in the help documents it has something for functions not the data list. Any suggestions? Thank you. Best, Pasha
From: Mark McClure on 4 Oct 2009 05:35 On Sat, Oct 3, 2009 at 9:05 AM, Pasha Karami <karami(a)geo.uu.nl> wrote: > I would like to plot 3D and contour plot of a list of data together > (in one plot) in Mathematica6. > I know in Mathematica 5.2 with ListShadowPlot3D we could > plot what i need. Plot3D and ListPlot3D return their output in the form Graphics3D[GraphicsComplex[{points, primitives}]] Thus, you can generate the plots, project the points, and display it all together. Here's an example: data = Table[ 3 (1 - x)^2 Exp[-x^2 - (y + 1)^2] - 10 (x/5 - x^3 - y^5) Exp[-x^2 - y^2] - (1/3) Exp[-(x + 1)^2 - y^2] + 20, {x, -3, 3, 0.5}, {y, -3, 3, 0.5}]; pic = ListPlot3D[data, PlotRange -> All, InterpolationOrder -> 2, MeshFunctions -> {#3 &}, ColorFunction -> (ColorData["SouthwestColors"][#3] &)]; project[{x_, y_, z_}] = {x, y, 0}; project[list : {{_, _, _} ..}] := project /@ list; Show[{pic, MapAt[project, pic, {1, 1}]}, PlotRange -> All, ViewPoint -> {2.06082, -2.4884, 1.0054}] Mark McClure
|
Pages: 1 Prev: How to store data files in packages Next: confused about == vs === in this equality |