Opened 11 years ago

Closed 10 years ago

#12214 closed defect (duplicate)

polygon documentation in error

Reported by: Karl-Dieter Crisman Owned by: jason, was
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: graphics Keywords: beginner sd35.5 sd40.5
Cc: Merged in:
Authors: Reviewers: Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Type polygon.options for a dictionary of the default options for polygons. 

This seems to not be correct.

sage: polygon.options
---------------------------------------------------------------------
AttributeError: 'function' object has no attribute 'options'

We should fix the documentation to

sage: sage.plot.polygon.polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness': 0}

or something else that fixes this.

Attachments (1)

trac_12214_polygon_options.patch (1.1 KB) - added by Kenny Smith 11 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by Kenny Smith

sage: polygon2d      
<function polygon2d at 0x9c61064>
sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness': 0}
sage: polygon3d
<function polygon3d at 0x9edcd14>
sage: polygon3d.options
{'color': (0, 0, 1), 'opacity': 1}

Here's what actually works

Changed 11 years ago by Kenny Smith

comment:2 Changed 11 years ago by Kenny Smith

Authors: ksmith
Status: newneeds_review

I just changed the references from polygon.options to polygon2d.options and polygon3d.options.

comment:3 Changed 11 years ago by Karl-Dieter Crisman

Authors: ksmithKenny Smith
Reviewers: Karl-Dieter Crisman
Status: needs_reviewneeds_work

Apparently the documentation is actually wrong about how reset works. I'll look into this. This should definitely be fixed at the same time, so "needs work", but the initial change is fine.

comment:4 Changed 11 years ago by Karl-Dieter Crisman

This is really weird. Apparently the resetting of options actually does work! But...

sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness': 0}
sage: P = polygon([[1,2], [5,6], [5,0]]); P # looks blue
sage: polygon2d.options['rgbcolor']=(1,0,0)
sage: P = polygon([[1,2], [5,6], [5,0]]); P # looks red
sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (1, 0, 0), 'thickness': 0}
sage: polygon2d.defaults()
{'alpha': 1, 'legend_label': None, 'rgbcolor': (0, 0, 1), 'thickness': 0}
sage: polygon2d.reset()
sage: polygon2d.options
{'alpha': 1, 'legend_label': None, 'rgbcolor': (1, 0, 0), 'thickness': 0}
sage: P = polygon([[1,2], [5,6], [5,0]]); P # looks blue again like it should

But for some reason the options never changed.

I've asked about this on sage-devel. But in any case if that doesn't work, it is also that way on disk and others (I've checked), so that wouldn't hold things up on this.

Anyway, that means we just have to change to polygon2d.reset() and polygon3d.reset().

comment:5 Changed 11 years ago by Kenny Smith

Authors: Kenny SmithKenneth Smith

comment:6 Changed 11 years ago by Kenny Smith

Keywords: sd35.5 added

comment:7 in reply to:  4 Changed 11 years ago by Karl-Dieter Crisman

But for some reason the options never changed.

This is now #12300.

comment:8 Changed 10 years ago by Karl-Dieter Crisman

Authors: Kenneth Smith
Milestone: sage-5.1sage-duplicate/invalid/wontfix
Status: needs_workpositive_review

This is a dup of #6367, more or less. Added the author of this patch there as well.

comment:9 Changed 10 years ago by Karl-Dieter Crisman

Keywords: sd40.5 added

comment:10 Changed 10 years ago by Jeroen Demeyer

Resolution: duplicate
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.