5
$\begingroup$

This is my first time posting a question. In general, I am trying to plot a polynomial over a parallelogram but ran into trouble with a square.

f[x_, y_] := x + y;
domain = Parallelogram[{1/4, 0}, {{1/4, 0}, {0, 1/4}}];
Plot3D[f[x, y], {x, y} ϵ domain]

This gives the error

Plot3D::idomdim: {x,y}ϵdomain does not have a valid dimension as a plotting domain.

I don't get an error if I provide the plotting domain another way

Plot3D[f[x, y], {x, 1/4, 1/2}, {y, 0, 1/4}]

I'm running Mathematica 11.3

$\endgroup$
2
  • 2
    $\begingroup$ It looks like the Region needs to be a MeshRegion.. perhaps try Plot3D[f[x,y],{x,y}\[Element]DiscretizeRegion@domain]. It would be nice if the documentation was clearer about this. $\endgroup$
    – chuy
    Commented Aug 29, 2018 at 17:59
  • $\begingroup$ Thanks @chuy! It's just odd that for most regions plotting works without DiscretizeRegion. For example, plotting over domain = Parallelogram[{1/4, 1/4}, {{1/4, 0}, {0, 1/4}}]; works fine. $\endgroup$
    – jerjorg
    Commented Aug 29, 2018 at 18:08

1 Answer 1

3
$\begingroup$

This is due to a bug in RegionDimension:

RegionDimension[Parallelogram[{1/4, 0}, {{1/4, 0}, {0,1/4}}]]

1

Please report this issue to support. As a workaround, make sure that the first direction is not identical to the origin (here I just scale the directions):

f[x_, y_] := x + y;
domain = Parallelogram[{1/4, 0}, 2 {{1/4, 0}, {0,1/4}}];
Plot3D[f[x,y], {x,y} ϵ domain]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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