Re: 2D Plot for a face of a 3D plot box?
- To: mathgroup at smc.vnet.net
- Subject: [mg122881] Re: 2D Plot for a face of a 3D plot box?
- From: Dan <dflatin at rcn.com>
- Date: Mon, 14 Nov 2011 07:06:56 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201111130943.EAA00017@smc.vnet.net> <j9ocj5$17u$1@smc.vnet.net>
On Nov 13, 7:18 am, Heike Gramberg <heike.gramb... at 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
- References:
- 2D Plot for a face of a 3D plot box?
- From: Brentt <brenttnewman@gmail.com>
- 2D Plot for a face of a 3D plot box?