#14175: More plot options for polytopes
---------------------------------------------------+------------------------
       Reporter:  nthiery                          |         Owner:  mhampton   
 
           Type:  defect                           |        Status:  
needs_review
       Priority:  major                            |     Milestone:  sage-5.8   
 
      Component:  geometry                         |    Resolution:             
 
       Keywords:                                   |   Work issues:             
 
Report Upstream:  N/A                              |     Reviewers:  Volker 
Braun
        Authors:  Volker Braun, Nicolas M. ThiƩry  |     Merged in:             
 
   Dependencies:                                   |      Stopgaps:             
 
---------------------------------------------------+------------------------
Description changed by vbraun:

Old description:

> This ticket implements plot options to control the graphical display of
> polygons:
> {{{
>     def plot(self,
>              point={}, line={}, polygon={},
>              wireframe={}, fill={},
>              **kwds):
>         """
>         Return a graphical representation.
>
>         INPUT:
>
>         - ``point``, ``line``, ``polygon`` -- Parameters to pass to
>           point (0d), line (1d), and polygon (2d) plot
>           commands. Allowed values are
>
>           * Python dictionary: Passed as keywords to the plot
>             commands.
>
>           * String or triple of numbers: The color. This is equivalent
>             to passing the dictionary ``{'color':...}``.
>
>           * ``None`` or ``False``: Switch off drawing of the
>             corresponding graphics options.
>
>         - ``wireframe``, ``fill`` -- Similar to ``point`` / ``line`` /
>           ``polygon``, but ``fill`` is used for the graphics objects
>           in the dimension of the polytope and ``wireframe`` is used
>           for all lower-dimensional graphics objects.
>
>         - ``**kwds`` -- optional keyword parameters that are passed to
>           all graphics objectcs.
>
>         OUTPUT:
>
>         A graphics object.
>
>         TESTS::
>
>             sage: square = polytopes.n_cube(2)
>             sage: plt = square.plot()
>             sage: for p in plt:
>             ...       print p.options()['rgbcolor'], p
>             (0, 0, 1) Point set defined by 4 point(s)
>             (0, 0, 1) Line defined by 2 points
>             (0, 0, 1) Line defined by 2 points
>             (0, 0, 1) Line defined by 2 points
>             (0, 0, 1) Line defined by 2 points
>             (0, 1, 0) Polygon defined by 4 points
>
>         Draw the lines in red and nothing else::
>
>             sage: plt = square.plot(point=None, line='red',
> polygon=False)
>             sage: for p in plt:
>             ...       print p.options()['rgbcolor'], p
>             red Line defined by 2 points
>             red Line defined by 2 points
>             red Line defined by 2 points
>             red Line defined by 2 points
>
>         Draw vertices in red, no lines, and a blue polygon::
>
>             sage: plt = square.plot(point={'color':'red'}, line=False,
> fill=(0,0,1))
>             sage: for p in plt:
>             ...       print p.options()['rgbcolor'], p
>             red Point set defined by 4 point(s)
>             (0, 0, 1) Polygon defined by 4 points
>         """
> }}}

New description:

 This ticket implements plot options to control the graphical display of
 polygons:
 {{{
     def plot(self,
              point={}, line={}, polygon={},
              wireframe={}, fill={},
              **kwds):
         """
         Return a graphical representation.

         INPUT:

         - ``point``, ``line``, ``polygon`` -- Parameters to pass to
           point (0d), line (1d), and polygon (2d) plot
           commands. Allowed values are

           * Python dictionary: Passed as keywords to the plot
             commands.

           * String or triple of numbers: The color. This is equivalent
             to passing the dictionary ``{'color':...}``.

           * ``None`` or ``False``: Switch off drawing of the
             corresponding graphics options.

         - ``wireframe``, ``fill`` -- Similar to ``point`` / ``line`` /
           ``polygon``, but ``fill`` is used for the graphics objects
           in the dimension of the polytope and ``wireframe`` is used
           for all lower-dimensional graphics objects.

         - ``**kwds`` -- optional keyword parameters that are passed to
           all graphics objectcs.

         OUTPUT:

         A graphics object.

         TESTS::

             sage: square = polytopes.n_cube(2)
             sage: plt = square.plot()
             sage: for p in plt:
             ...       print p.options()['rgbcolor'], p
             (0, 0, 1) Point set defined by 4 point(s)
             (0, 0, 1) Line defined by 2 points
             (0, 0, 1) Line defined by 2 points
             (0, 0, 1) Line defined by 2 points
             (0, 0, 1) Line defined by 2 points
             (0, 1, 0) Polygon defined by 4 points

         Draw the lines in red and nothing else::

             sage: plt = square.plot(point=None, line='red', polygon=False)
             sage: for p in plt:
             ...       print p.options()['rgbcolor'], p
             red Line defined by 2 points
             red Line defined by 2 points
             red Line defined by 2 points
             red Line defined by 2 points

         Draw vertices in red, no lines, and a blue polygon::

             sage: plt = square.plot(point={'color':'red'}, line=False,
 fill=(0,0,1))
             sage: for p in plt:
             ...       print p.options()['rgbcolor'], p
             red Point set defined by 4 point(s)
             (0, 0, 1) Polygon defined by 4 points
         """
 }}}

 Apply trac_14175_plot_options.patch

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14175#comment:18>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to