3
$\begingroup$

I have the following simple RegionPlot of a RegionUnion:

RegionPlot[RegionUnion[
  Rectangle[{-0.125, -0.125}, {0.125, 0.125}],  
  Rectangle[{0.126, -0.05}, {0.425, 0.05}]
], AspectRatio -> Automatic]

This looks all good, but when I change the 0.126 to 0.125 to merge the two rectangles the union drops two corners of the region:

enter image description here

What is going wrong here and how can I display the correct region? Strangely enough with different numeric values it seems to work.

$\endgroup$
10
  • 1
    $\begingroup$ What version of Mathematica are you running? I got my results with V10.2 running on OS X 10.10.2 $\endgroup$
    – m_goldberg
    Sep 19 '15 at 23:38
  • $\begingroup$ I get what the OP has shown with V10.0 in Windows 10 (64-bit) $\endgroup$
    – Hubble07
    Sep 20 '15 at 7:20
  • $\begingroup$ Strange, I get what m_goldberg has on versions 10.0.2, 10.1 and 10.2 (Win 8.1 64 bit). $\endgroup$ Sep 20 '15 at 14:57
  • $\begingroup$ @Hubble07 What is your $ReleaseNumber? $\endgroup$ Sep 20 '15 at 15:03
  • $\begingroup$ $ReleaseNumber is 0 $\endgroup$
    – Hubble07
    Sep 20 '15 at 15:46
1
$\begingroup$

This is not an answer, but a comment in which I need to show an image.

I don't see any problem with your code. When I evaluate

RegionPlot[
  RegionUnion[
    Rectangle[{-0.125, -0.125}, {0.125, 0.125}], 
    Rectangle[{0.125, -0.05}, {0.425, 0.05}]],
  AspectRatio -> Automatic]

I get

region

which is exactly what I expect. Are you getting something different? Or, if you getting the same image, why do you think it is wrong?

$\endgroup$
4
  • $\begingroup$ Added an image showing how it looks for me $\endgroup$
    – Danvil
    Sep 19 '15 at 23:36
  • 1
    $\begingroup$ I'm on 10.2 and duplicated m_goldberg's result. $\endgroup$ Sep 20 '15 at 1:58
  • $\begingroup$ I get (almost) your result. That "(almost)" is because the OP has 0.126 in the second rectangle instead of the 0.125 you used. $\endgroup$ Sep 20 '15 at 15:01
  • $\begingroup$ @SjoerdC.deVries: The image I show is when using 0.125. With 0.126 it looks ok, but the rectangles are not joined (which is not what I want). $\endgroup$
    – Danvil
    Sep 21 '15 at 16:49

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.