4
$\begingroup$

Bug introduced in 11.2. Fixed in 12.2.0 or earlier.


Ω = 
  RegionDifference[Rectangle[{0, 0}, {100, 100}], 
   Rectangle[{40, 40}, {60, 60}]];
RegionPlot[Ω]

DensityPlot[x^2 + y^2, {x, y} ∈ Ω]

when I run it in v11.2 I got

enter image description here

while I run it in v11 I got

enter image description here

so is it a bug?

$\endgroup$
10
  • 1
    $\begingroup$ (Please only use the bugs tag for bugs confirmed by the community. Read the tag info page for more details) $\endgroup$
    – user202729
    May 19, 2018 at 3:44
  • $\begingroup$ (observation: note the "0..2" labels on the axes. The data is correct, the PlotRange detection is unexpected) $\endgroup$
    – user202729
    May 19, 2018 at 4:00
  • $\begingroup$ @user202729 yes,the range is different ,but in v11 it runs out the correct range automaticly so in v11.2 we should operate mannually? $\endgroup$
    – dcydhb
    May 19, 2018 at 4:02
  • $\begingroup$ @user202729 also we can use the RegionPlot rather than DensityPlot so we must set the range mannually? $\endgroup$
    – dcydhb
    May 19, 2018 at 4:04
  • $\begingroup$ I consider it a bug. A workaround is RegionPlot[\[CapitalOmega], PlotRange -> {{0, 100}, {0, 100}}] and DensityPlot[x^2 + y^2, {x, 0, 100}, {y, 0, 100}, RegionFunction -> Function[{x, y, f}, {x, y} \[Element] \[CapitalOmega]]] $\endgroup$
    – Bob Hanlon
    May 19, 2018 at 4:17

1 Answer 1

1
$\begingroup$

Edit: according to the comment by @kirma it is fixed already since 12.2

Update from 13.2.0

With

Ω = 
  RegionDifference[Rectangle[{0, 0}, {100, 100}], 
   Rectangle[{40, 40}, {60, 60}]];
RegionPlot[Ω]
DensityPlot[x^2 + y^2, {x, y} ∈ \[CapitalOmega]]

we get

pp1

pp2

$\endgroup$
2
  • 1
    $\begingroup$ This also seems to work on v12.2, might have been fixed even earlier... $\endgroup$
    – kirma
    Feb 4 at 9:16
  • 1
    $\begingroup$ @kirma I just saw you updated the bugs header. Thanks a lot for that and for letting me know! $\endgroup$
    – bmf
    Feb 4 at 9:17

Your Answer

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

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