#11677: Polygon fill doesn't work
------------------------+---------------------------------------------------
   Reporter:  kcrisman  |          Owner:  jason, was         
       Type:  defect    |         Status:  new                
   Priority:  minor     |      Milestone:  sage-4.8           
  Component:  graphics  |       Keywords:  beginner           
Work_issues:            |       Upstream:  N/A                
   Reviewer:            |         Author:  Karl-Dieter Crisman
     Merged:            |   Dependencies:                     
------------------------+---------------------------------------------------

Old description:

> From [http://groups.google.com/group/sage-
> support/browse_thread/thread/ad4f646974dbc847 this sage-support thread]:
>
> ----
>
> Hello,
> {{{
> ------- -----------
> P = polygon([[1,2], [5,6], [5,0]], fill = False, color='red')
> P
> ------- -----------
> }}}
> still fills the polygon, is there another way to turn off color fill.
> Thanks.
> -Giri
>
> ----
> The fix is to add
> {{{
>          z = int(options.pop('zorder', 1))
>          p.set_alpha(a)
> +        f = options.pop('fill', False)
> +        p.set_fill(f)
>          c = to_mpl_color(options['rgbcolor'])
>          p.set_edgecolor(c)
> }}}
> in `Polygon._render_on_subplot` in sage/plot/polygon.py.
>

> Notice that this means to actually ''get'' such a polygon, you would need
> to set the thickness.  Is that a bug?  We do intentionally have the
> thickness 0 in the `@options`.
> {{{
> sage: P = polygon([[1,2], [5,6], [5,0]], fill = False, thickness=1) ; P
> sage: P = polygon([[1,2], [5,6], [5,0]], fill = False) ; P
> }}}

New description:

 From [http://groups.google.com/group/sage-
 support/browse_thread/thread/ad4f646974dbc847 this sage-support thread]:

 ----

 Hello,
 {{{
 ------- -----------
 P = polygon([[1,2], [5,6], [5,0]], fill = False, color='red')
 P
 ------- -----------
 }}}
 still fills the polygon, is there another way to turn off color fill.
 Thanks.
 -Giri

 ----
 The fix is to add
 {{{
          z = int(options.pop('zorder', 1))
          p.set_alpha(a)
 +        f = options.pop('fill', True)
 +        p.set_fill(f)
          c = to_mpl_color(options['rgbcolor'])
          p.set_edgecolor(c)
 }}}
 in `Polygon._render_on_subplot` in sage/plot/polygon.py.


 Notice that this means to actually ''get'' such a polygon, you would need
 to set the thickness.  Is that a bug?  We do intentionally have the
 thickness 0 in the `@options`.
 {{{
 sage: P = polygon([[1,2], [5,6], [5,0]], fill = False, thickness=1) ; P
 sage: P = polygon([[1,2], [5,6], [5,0]], fill = False) ; P
 }}}

--

Comment(by kcrisman):

 Oops!  The default fill should be True, of course.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11677#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to