Opened 13 years ago

Closed 13 years ago

#7793 closed defect (fixed)

zorder not implemented in disk

Reported by: kcrisman Owned by: was
Priority: minor Milestone: sage-4.3.3
Component: graphics Keywords:
Cc: jason Merged in: sage-4.3.3.alpha0
Authors: Karl-Dieter Crisman Reviewers: Ross Kyprianou
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

From the report a bug link:

It seems that the zorder does not work with disk(). I found a report saying that this was resolved for point() and polygon(), (and I know it works) but nothing about disk(). I found this using the following test:

d1 = disk((0,0), 1, (0, 2*pi), color = 'red', zorder=0) 
d2 = disk((0,0), 0.75, (0, 2*pi), color = 'brown', zorder=1)
d3 = disk((0,0), 0.5, (0, 2*pi), color = 'green', zorder= 2)
d4 = disk((0,0), 0.25, (0, 2*pi), color = 'yellow', zorder=3)
final = d4 + d3 + d2 + d1
final.show(aspect_ratio = 1)

Incidentally (not in the report), this shows that axes apparently have default zorder of 2. So do arrows, but polygons have a default of 1. This is confusing.

Attachments (1)

trac_7793-zorder-disk.patch (1.3 KB) - added by kcrisman 13 years ago.
Based on 4.3

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by kcrisman

Based on 4.3

comment:1 Changed 13 years ago by kcrisman

  • Cc jason added
  • Status changed from new to needs_review

Would be open to suggestions as to how to handle the issues raised in this thread, but for now this is up for review.

comment:2 Changed 13 years ago by rossk

  • Status changed from needs_review to positive_review

The patch fixes the zorder problem (the code below produces 3 colorful bullseyes).

sage: d1 = disk((0,0), 1, (0, 2*pi), color = 'red', zorder=0) 
sage: d2 = disk((0,0), 0.75, (0, 2*pi), color = 'brown', zorder=1)
sage: d3 = disk((0,0), 0.5, (0, 2*pi), color = 'green', zorder= 2)
sage: d4 = disk((0,0), 0.25, (0, 2*pi), color = 'yellow', zorder=3)
sage: final = d4 + d3 + d2 + d1
sage: final.show(aspect_ratio = 1) 
sage: final2 = d1 + d2 + d3 + d4                                   
sage: final2.show(aspect_ratio = 1)                                
sage: final3 = d3 + d2 + d4 + d1   
sage: final3.show(aspect_ratio = 1)

(Note: Intuitively, final, final2 and final3 should all produce the same image and they do)

comment:3 Changed 13 years ago by mpatel

  • Authors set to Karl-Dieter Crisman
  • Merged in set to sage-4.3.3.alpha0
  • Resolution set to fixed
  • Reviewers set to Ross Kyprianou
  • Status changed from positive_review to closed

Please remember to update the relevant ticket fields --- the release managers use an automated script to generate lists of merged tickets.

Note: See TracTickets for help on using tickets.