Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

This code adapted from Placing a ContourPlot under a Plot3DPlacing a ContourPlot under a Plot3D works pretty well.

u[x_, y_] := x^.5 y^.5
contour = 
 ContourPlot[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  Axes -> False, Contours -> 15, PlotPoints -> 50, 
  PlotRangePadding -> 0, ColorFunction -> "Aquamarine"]
potential1 = 
 Plot3D[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 15, 
  MeshStyle -> Opacity[.5], 
  MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], LightBlue}}, 
  PlotRange -> {Automatic, Automatic, {min, 2}}, Lighting -> "Neutral"]
Show[potential1, 
 Graphics3D[contour[[1]] /. {x_Real, y_Real} :> {x, y, 0}], 
 BoxRatios -> {1, 1, 0.6}, FaceGrids -> {Back, Left}]

Here is the outcome:

enter image description here

I wonder how to reuse the color function on the contour plot to have identical colors.

This code adapted from Placing a ContourPlot under a Plot3D works pretty well.

u[x_, y_] := x^.5 y^.5
contour = 
 ContourPlot[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  Axes -> False, Contours -> 15, PlotPoints -> 50, 
  PlotRangePadding -> 0, ColorFunction -> "Aquamarine"]
potential1 = 
 Plot3D[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 15, 
  MeshStyle -> Opacity[.5], 
  MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], LightBlue}}, 
  PlotRange -> {Automatic, Automatic, {min, 2}}, Lighting -> "Neutral"]
Show[potential1, 
 Graphics3D[contour[[1]] /. {x_Real, y_Real} :> {x, y, 0}], 
 BoxRatios -> {1, 1, 0.6}, FaceGrids -> {Back, Left}]

Here is the outcome:

enter image description here

I wonder how to reuse the color function on the contour plot to have identical colors.

This code adapted from Placing a ContourPlot under a Plot3D works pretty well.

u[x_, y_] := x^.5 y^.5
contour = 
 ContourPlot[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  Axes -> False, Contours -> 15, PlotPoints -> 50, 
  PlotRangePadding -> 0, ColorFunction -> "Aquamarine"]
potential1 = 
 Plot3D[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 15, 
  MeshStyle -> Opacity[.5], 
  MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], LightBlue}}, 
  PlotRange -> {Automatic, Automatic, {min, 2}}, Lighting -> "Neutral"]
Show[potential1, 
 Graphics3D[contour[[1]] /. {x_Real, y_Real} :> {x, y, 0}], 
 BoxRatios -> {1, 1, 0.6}, FaceGrids -> {Back, Left}]

Here is the outcome:

enter image description here

I wonder how to reuse the color function on the contour plot to have identical colors.

Tweeted twitter.com/StackMma/status/819376017458495488
added 1 character in body; edited title
Source Link
David G. Stork
  • 42.3k
  • 3
  • 37
  • 106

Color consistency in Plot3D with 2D projection

This code adapted from Placing a ContourPlot under a Plot3D works pretypretty well.

u[x_, y_] := x^.5 y^.5
contour = 
 ContourPlot[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  Axes -> False, Contours -> 15, PlotPoints -> 50, 
  PlotRangePadding -> 0, ColorFunction -> "Aquamarine"]
potential1 = 
 Plot3D[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 15, 
  MeshStyle -> Opacity[.5], 
  MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], LightBlue}}, 
  PlotRange -> {Automatic, Automatic, {min, 2}}, Lighting -> "Neutral"]
Show[potential1, 
 Graphics3D[contour[[1]] /. {x_Real, y_Real} :> {x, y, 0}], 
 BoxRatios -> {1, 1, 0.6}, FaceGrids -> {Back, Left}]

Here is the outcome:

enter image description here

I wonder how to reuse the color function on the contour plot to have identical colors.

Plot3D with projection

This code adapted from Placing a ContourPlot under a Plot3D works prety well.

u[x_, y_] := x^.5 y^.5
contour = 
 ContourPlot[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  Axes -> False, Contours -> 15, PlotPoints -> 50, 
  PlotRangePadding -> 0, ColorFunction -> "Aquamarine"]
potential1 = 
 Plot3D[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 15, 
  MeshStyle -> Opacity[.5], 
  MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], LightBlue}}, 
  PlotRange -> {Automatic, Automatic, {min, 2}}, Lighting -> "Neutral"]
Show[potential1, 
 Graphics3D[contour[[1]] /. {x_Real, y_Real} :> {x, y, 0}], 
 BoxRatios -> {1, 1, 0.6}, FaceGrids -> {Back, Left}]

Here is the outcome:

enter image description here

I wonder how to reuse the color function on the contour plot to have identical colors.

Color consistency in Plot3D with 2D projection

This code adapted from Placing a ContourPlot under a Plot3D works pretty well.

u[x_, y_] := x^.5 y^.5
contour = 
 ContourPlot[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  Axes -> False, Contours -> 15, PlotPoints -> 50, 
  PlotRangePadding -> 0, ColorFunction -> "Aquamarine"]
potential1 = 
 Plot3D[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 15, 
  MeshStyle -> Opacity[.5], 
  MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], LightBlue}}, 
  PlotRange -> {Automatic, Automatic, {min, 2}}, Lighting -> "Neutral"]
Show[potential1, 
 Graphics3D[contour[[1]] /. {x_Real, y_Real} :> {x, y, 0}], 
 BoxRatios -> {1, 1, 0.6}, FaceGrids -> {Back, Left}]

Here is the outcome:

enter image description here

I wonder how to reuse the color function on the contour plot to have identical colors.

added 1 character in body
Source Link
corey979
  • 24.3k
  • 7
  • 60
  • 105

This code adapted from Placing a ContourPlot under a Plot3D works prety well.

u[x_, y_] := x^.5 y^.5
contour = 
 ContourPlot[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  Axes -> False, Contours -> 15, PlotPoints -> 50, 
  PlotRangePadding -> 0, ColorFunction -> "Aquamarine"]
potential1 = 
 Plot3D[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 15, 
  MeshStyle -> Opacity[.5], 
  MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], LightBlue}}, 
  PlotRange -> {Automatic, Automatic, {min, 2}}, Lighting -> "Neutral"]
Show[potential1, 
 Graphics3D[contour[[1]] /. {x_Real, y_Real} :> {x, y, 0}], 
 BoxRatios -> {1, 1, 0.6}, FaceGrids -> {Back, Left}]

Here is the outcome:

enter image description here

I wonder how reuse to reuse the color function on the contour plot to have identical colors.

This code adapted from Placing a ContourPlot under a Plot3D works prety well.

u[x_, y_] := x^.5 y^.5
contour = 
 ContourPlot[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  Axes -> False, Contours -> 15, PlotPoints -> 50, 
  PlotRangePadding -> 0, ColorFunction -> "Aquamarine"]
potential1 = 
 Plot3D[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 15, 
  MeshStyle -> Opacity[.5], 
  MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], LightBlue}}, 
  PlotRange -> {Automatic, Automatic, {min, 2}}, Lighting -> "Neutral"]
Show[potential1, 
 Graphics3D[contour[[1]] /. {x_Real, y_Real} :> {x, y, 0}], 
 BoxRatios -> {1, 1, 0.6}, FaceGrids -> {Back, Left}]

Here is the outcome

enter image description here

I wonder how reuse the color function on the contour plot to have identical colors

This code adapted from Placing a ContourPlot under a Plot3D works prety well.

u[x_, y_] := x^.5 y^.5
contour = 
 ContourPlot[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  Axes -> False, Contours -> 15, PlotPoints -> 50, 
  PlotRangePadding -> 0, ColorFunction -> "Aquamarine"]
potential1 = 
 Plot3D[u[x, y], {x, 0, 1}, {y, 0, 1}, PlotRange -> {0, 1}, 
  ClippingStyle -> None, MeshFunctions -> {#3 &}, Mesh -> 15, 
  MeshStyle -> Opacity[.5], 
  MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], LightBlue}}, 
  PlotRange -> {Automatic, Automatic, {min, 2}}, Lighting -> "Neutral"]
Show[potential1, 
 Graphics3D[contour[[1]] /. {x_Real, y_Real} :> {x, y, 0}], 
 BoxRatios -> {1, 1, 0.6}, FaceGrids -> {Back, Left}]

Here is the outcome:

enter image description here

I wonder how to reuse the color function on the contour plot to have identical colors.

Source Link
Loading