3
$\begingroup$

I am trying to plot this 3D function over a hexagonal region:

a1 = Sqrt[3] {1, 0};
a2 = Sqrt[3] {1/2, Sqrt[3]/2};
k = {kx, ky};
S = 1 + Exp[I k. a2] + Exp[I k.(a2 - a1)];
EE = Abs[S]
R = 4 Pi/(3 Sqrt[3]);
ep = Plot3D[{EE, -EE}, {kx, ky} \[Element] RegularPolygon[R, 6], Axes -> False, Boxed -> False, AspectRatio -> 2]

This works fine, but I would also like to draw the region under the 3D graph, something like:

bz = Graphics[RegularPolygon[R, 6]];

or

bz = RegionPlot[RegularPolygon[R, 6]];

However, using

Show[ep, bz]

doesn't work. I have found a few similar questions but they mostly seem to be about contours, I didn't know how to extend this for something as simple as a regular polygon.

$\endgroup$
2
  • $\begingroup$ do you want you Polygon flat under the region of 3D !? $\endgroup$
    – Alrubaie
    Mar 28 '19 at 20:28
  • $\begingroup$ Try This p = Graphics3D[Polygon[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]] $\endgroup$
    – Alrubaie
    Mar 28 '19 at 20:30
5
$\begingroup$

Try this:

region = Graphics3D[Polygon[CirclePoints[R, 6] /. {x_, y_} :> {x, y, -3}]];
Show[ep,region]

Mathematica graphics

$\endgroup$
4
  • $\begingroup$ Works perfectly, thank you! $\endgroup$
    – Ash
    Mar 28 '19 at 20:41
  • $\begingroup$ @Ash You are very welcome! Thank you for the accept as well! $\endgroup$
    – MarcoB
    Mar 28 '19 at 20:42
  • $\begingroup$ That's nice! What AspectRatio did you use? $\endgroup$
    – mjw
    Mar 28 '19 at 21:49
  • $\begingroup$ @mjw Thank you! The aspect ratio is inherited from ep, which was in the OP's original code; they had set it to $2$. $\endgroup$
    – MarcoB
    Mar 28 '19 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.