Opened 7 years ago

Closed 6 years ago

#16907 closed defect (duplicate)

Adding two region plots yields surprising results

Reported by: kcrisman Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: graphics Keywords:
Cc: kcrisman, mkoeppe, vdelecroix Merged in:
Authors: Yuan Zhou Reviewers: Punarbasu Purkayastha
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by ppurka)

I have removed the branch from this ticket. Once #18286 is positively reviewed, I will set this too to positive review. - ppurka


And wrong ones, of course. See this sage-support thread.

sage: disc1= region_plot(lambda x, y : x^2+y^2 < 1, (x, -1, 1), (y, -1, 1))
sage: disc2= region_plot(lambda x, y : (x-0.7)^2+(y-0.7)^2 < 0.5, (x, -2, 2), (y, -2, 2) )

then do disc1+disc2 and disc2+disc1 for some surprises. Most likely we are abusing contourf in matplotlib a little by allowing the adding of these plots.

Change History (14)

comment:1 Changed 7 years ago by ppurka

cc: me. Also, I don't see how this could be fixed. :(

comment:2 Changed 6 years ago by yzh

  • Authors set to Yuan Zhou
  • Branch set to u/yzh/region_plot
  • Cc kcrisman mkoeppe ppurk added
  • Commit set to c0770dc34e8482eb5d1c04338820e361a2a4cb4b
  • Milestone changed from sage-6.4 to sage-6.7
  • Status changed from new to needs_review

comment:3 Changed 6 years ago by mkoeppe

  • Cc vdelecroix added

comment:4 follow-up: Changed 6 years ago by kcrisman

  • Cc ppurk removed

Interesting fix! Do you think the change in the "endpoints" for the contours will make a big difference? Thanks for the contribution, I'll put this on my list for things to review once the semester is over.

comment:5 in reply to: ↑ 4 Changed 6 years ago by yzh

Replying to kcrisman:

Interesting fix! Do you think the change in the "endpoints" for the contours will make a big difference? Thanks for the contribution, I'll put this on my list for things to review once the semester is over.

Do you mean the change of contours from [-1e307, 0, 1e307] to [-1e-20, 0, 1e-20]? Yes, I think setting contours=[-1e307, 0, 1e307] was not a good idea. I tried

sage: x,y = var('x,y')
sage: region_plot(x^2+y^2 < 1, (x, -1, 1), (y, -1, 1), incol='blue', outcol='red',alpha=0.5)

with setting contours=[-0.2, 0, 0.2], and figured out that the meaning of the "endpoints" was quite different from what I had imagined.

comment:6 Changed 6 years ago by git

  • Commit changed from c0770dc34e8482eb5d1c04338820e361a2a4cb4b to 9ae38d4f8c7fe78a1039b443aa3a9d802bc3b869

Branch pushed to git repo; I updated commit sha1. New commits:

9ae38d4Modify region_plot(): works for equation conditions as well

comment:7 Changed 6 years ago by git

  • Commit changed from 9ae38d4f8c7fe78a1039b443aa3a9d802bc3b869 to 7e336a1101995eea35abf373639db5d3a397399c

Branch pushed to git repo; I updated commit sha1. New commits:

7e336a1change the sagetrac ticket format

comment:8 Changed 6 years ago by vdelecroix

Why is there a duplicate ticket at #18286?

comment:9 Changed 6 years ago by ppurka

  • Branch u/yzh/region_plot deleted
  • Commit 7e336a1101995eea35abf373639db5d3a397399c deleted
  • Description modified (diff)
  • Reviewers set to Punarbasu Purkayastha

I have removed the branch from this ticket. Once #18286 is positively reviewed, I will set this too to positive review.

comment:10 Changed 6 years ago by ppurka

  • Status changed from needs_review to positive_review

comment:11 Changed 6 years ago by vbraun

What am I supposed to do with this ticket? If you want it closed without merging a branch: This ticket should be set to duplicate/invalid/wontfix, and #18286 should not depend on this ticket.

comment:12 Changed 6 years ago by ppurka

  • Status changed from positive_review to needs_review

comment:13 Changed 6 years ago by ppurka

  • Milestone changed from sage-6.7 to sage-duplicate/invalid/wontfix
  • Status changed from needs_review to positive_review

comment:14 Changed 6 years ago by vbraun

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.