Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6431
| From | Dan <dflatin@rcn.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: 2D Plot for a face of a 3D plot box? |
| Date | 2011-11-14 12:09 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j9r0df$bfu$1@smc.vnet.net> (permalink) |
| References | <201111130943.EAA00017@smc.vnet.net> <j9ocj5$17u$1@smc.vnet.net> |
On Nov 13, 7:18 am, Heike Gramberg <heike.gramb...@gmail.com> wrote:
> You could use MeshFunctions to draw curves on a 3D surface. For example
>
> f[x_, y_] := Sin[x y];
> Plot3D[f[x, y], {x, 0, 2 Pi}, {y, 0, 2 Pi}, PlotPoints -> 40,
> MeshFunctions -> Function[{x, y, z}, (x - Pi)^2 + (y - Pi)^2],
> Mesh -> {{4}},
> MeshStyle -> {Thick, Blue}]
>
> Alternatively, you could use ParametricPlot3D to draw the curve
> separately and use Show to combine the plots, e.g.
>
> Show[{Plot3D[Sin[x y], {x, 0, 2 Pi}, {y, 0, 2 Pi}, Mesh -> None,
> PlotPoints -> 40],
> ParametricPlot3D[{Pi + 2 Cos[t], Pi + 2 Sin[t], f[Pi + 2 Cos[t], Pi +
> 2 Sin[t]]},
> {t, 0, 2 Pi},
> PlotStyle -> {Thick, Blue}]}]
>
> You can also use this method to plot graphs on the bounding box of a 3D
> plot. For example
>
> With[{bb = {{0, 2 Pi}, {0, 2 Pi}, {-1.5, 1.5}}},
> Show[{
> Plot3D[Sin[x y], {x, 0, 2 Pi}, {y, 0, 2 Pi}, Mesh -> None, PlotPoints
> -> 40],
> ParametricPlot3D[{Pi + 2 Cos[t], Pi + 2 Sin[t], bb[[3, -1]]},
> {t, 0, 2 Pi},
> PlotStyle -> {Thick, Red}]},
> PlotRange -> bb]]
>
> Heike
>
> On 13 Nov 2011, at 10:43, Brentt wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > Is there a way to have a 2D plot on a face of the bounding box of a 3D
> > surface plot? Only ordered pairs in the 2D function would have any opacity
> > of course, so the view of the 3D surface won't be obstructed.
While not exactly what the original poster wanted, here is one more
possibility for combining 2D and 3D plots:
With[{bb={{0,2 Pi},{0,2 Pi},{-1.5,1.5}}},
Module[{cplot,vtc,cpanecoords},
cplot=Texture[Rasterize@ContourPlot[Sin[x y],{x,0,2 Pi},{y,0,2
Pi},Frame->False]];
vtc={{0,0},{1,0},{1,1},{0,1}};
cpanecoords={{0,0,1.5},{0,2Pi,1.5},{2Pi,2Pi,1.5},{2Pi,0,1.5}};
Show[{
Graphics3D[{Opacity[0.5],cplot,Polygon[cpanecoords,VertexTextureCoordinates-
>vtc]}],
Plot3D[Sin[x y],{x,0,2 Pi},{y,0,2 Pi},Mesh->None,PlotPoints->40]
}]
]
]
-- Dan
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: 2D Plot for a face of a 3D plot box? Heike Gramberg <heike.gramberg@gmail.com> - 2011-11-13 12:18 +0000 Re: 2D Plot for a face of a 3D plot box? Dan <dflatin@rcn.com> - 2011-11-14 12:09 +0000
csiph-web