#14741: Fix implicit_plot()  so that we can save PDF's
----------------------------+-----------------------------------------------
       Reporter:  zimmerma  |         Owner:  jason, was  
           Type:  defect    |        Status:  needs_review
       Priority:  major     |     Milestone:  sage-5.11   
      Component:  graphics  |    Resolution:              
       Keywords:            |   Work issues:              
Report Upstream:  N/A       |     Reviewers:              
        Authors:            |     Merged in:              
   Dependencies:            |      Stopgaps:              
----------------------------+-----------------------------------------------
Changes (by john_perry):

  * status:  new => needs_review


Old description:

> In Sage 5.9:
> {{{
> sage: f = lambda x, y : (abs(cos((x + I * y) ** 4)) - 1)
> sage: g2 = implicit_plot(f,(-4, 4),(-3, 3),linewidth=0.6)
> sage: g2.save('/tmp/cosz4_2.pdf')
> TypeError: Don't know a PDF representation for <type
> 'sage.rings.real_mpfr.RealLiteral'> objects.
> }}}
> See also #13732.

New description:

 In Sage 5.9:
 {{{
 sage: f = lambda x, y : (abs(cos((x + I * y) ** 4)) - 1)
 sage: g2 = implicit_plot(f,(-4, 4),(-3, 3),linewidth=0.6)
 sage: g2.save('/tmp/cosz4_2.pdf')
 TypeError: Don't know a PDF representation for <type
 'sage.rings.real_mpfr.RealLiteral'> objects.
 }}}
 See also #13732.

 '''Apply''':

     1.
 [attachment:trac_14741_graphics_primitive_options_for_matplotlib.patch]

--

Comment:

 Near as I can tell, the best solution is to add a `set_options` method to
 the `GraphicPrimitive` class, then modify the `matplotlib` function to
 ensure the options have type `float`, rather than `RealLiteral`. This
 keeps the patch short, clean, and simple. I added corresponding doctests,
 which test fine for me. This fixes the bug on my machine.

 I suspect we should be able to remove all the hacks being used in other
 files to convert options to `float` (e.g., `circle`, `disc`, `line`, ...).
 That is not part of this patch, though I could add another patch to do so,
 if desirable.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14741#comment:6>
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to