[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2013-02-09 Thread john_perry_usm
I have uploaded a patch to the trac, ticket 13732, which fixes this for all 
the plot commands that seem to accept alpha. (To find them, I performed a grep 
alpha sage/plot/*py and looked at those files.) The doctests in sage/plot 
pass for me, though I had to make some changes to older doctests because 
float gives a different output; I haven't yet tried doctesting anything 
outside of that directory.

I couldn't find anything that made the save command choke like this except 
the alpha option, though I didn't try very hard. I hope someone reviews it; 
it should be easy, unless I did something stupid.

john perry

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2013-02-09 Thread kcrisman



 With this change, I can sage PDF with alpha, and it probably fixes a lot 
 of other thing


Huh.  See http://trac.sagemath.org/sage_trac/ticket/14074 for an example 
where alpha works fine with saving as a pdf.  Of course, you could always 
put the alpha to float(.5) or something...
 

 s, as well.

 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2012-11-26 Thread Volker Braun
On Monday, November 26, 2012 2:07:34 PM UTC, john_perry_usm wrote:

 Is it a good idea to patch the matplotlib package with a test of whether 
 an object is a sage object?


Definitely not!

If possible, matplotlib should rely on duck-typing:

try:
alpha = float(obj)
except ValueError:
here we know that obj is not a float
 

 If not, the solution is probably to patch sage's commands that create 
 graphics, to change RealLiteral's to float's.


That should be fixed as well. Sage shouldn't feed its own floating point 
classes to 3rd-party libraries, they certainly aren't doctested with 
extended precision floating point numbers.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2012-11-20 Thread john_perry_usm
Hello

Finally got round to it.

On Thursday, November 15, 2012 11:44:36 AM UTC-6, Volker Braun wrote:

 I think I saw that before. Maybe converting coordinates to RDF works? 
 Please open a ticket if you can isolate a test case.


RDF doesn't work, either. float does.

I'm trying to write up a patch now. The alpha option should in fact be 
float, and not RFE or RDF, should it? I was thinking of making the change 
there, when the option is set, though I could also convert RDF etc. to 
float in the backend.

john perry 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2012-11-20 Thread john_perry_usm
Jason

On Thursday, November 15, 2012 12:01:02 PM UTC-6, Jason Grout wrote:

 Can you get a small test case for us to play with? 


sage: p = disk((0,0),5,(0,pi/4),color='red')
sage: p += disk((0,0),5,(pi/4,pi/2),color='red',alpha=0.5)
sage: p.save(test.pdf) 

This fails for me. If I change the second line to end with 
...alpha=float(0.5)) then it works.

regards
john perry

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2012-11-20 Thread john_perry_usm
Okay, does anyone know how I change files in the library in such a way that 
mercurial actually notices?

I can modify the matplotlib backend for PDF's so that this works, but those 
files don't show up in the source directory, so hg doesn't pick up on the 
changes. How do I supply a patch for this circumstance?

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2012-11-20 Thread Dima Pasechnik
On 2012-11-20, john_perry_usm john.pe...@usm.edu wrote:
 --=_Part_212_31060160.1353448773382
 Content-Type: text/plain; charset=ISO-8859-1

 Okay, does anyone know how I change files in the library in such a way that 
 mercurial actually notices?

 I can modify the matplotlib backend for PDF's so that this works, but those 
 files don't show up in the source directory, so hg doesn't pick up on the 
 changes. How do I supply a patch for this circumstance?
add a patch to the matplotlib spkg, and create a new version of it.

HTH,
Dmitrii 


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2012-11-20 Thread Jason Grout

On 11/20/12 8:59 PM, Dima Pasechnik wrote:

On 2012-11-20, john_perry_usm john.pe...@usm.edu wrote:

--=_Part_212_31060160.1353448773382
Content-Type: text/plain; charset=ISO-8859-1

Okay, does anyone know how I change files in the library in such a way that
mercurial actually notices?

I can modify the matplotlib backend for PDF's so that this works, but those
files don't show up in the source directory, so hg doesn't pick up on the
changes. How do I supply a patch for this circumstance?

add a patch to the matplotlib spkg, and create a new version of it.


Or even better, in my opinion, post the patch to the matplotlib mailing 
list, or make the change in the matplotlib github source and submit a 
pull request to them.


Or post the patch here and I can forward it to the matplotlib mailing list.

Jason



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2012-11-15 Thread Volker Braun
I think I saw that before. Maybe converting coordinates to RDF works? 
Please open a ticket if you can isolate a test case.



On Thursday, November 15, 2012 12:12:07 PM UTC-5, john_perry_usm wrote:

 Hello

 I have created a nice graphic with some alpha. I try to save it. As a Sage 
 object, I have no problem. The EPS representation doesn't preserve the 
 alpha. The PNG does, but I'd prefer vector graphics.

 The PDF representation chokes on it. I get the error,

 TypeError: Don't know a PDF representation for type 
 'sage.rings.real_mpfr.RealLiteral' objects.

 I'll use the PNG for now, but has anyone else encountered this, and/or 
 found a workaround? I am using 5.4 on Fedora Verne, whichever number that 
 is.

 regards
 john perry


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Don't know a PDF representation for alpha in graphics?

2012-11-15 Thread john_perry_usm
I will try that, thanks. I'll also open a ticket in coming days.

john

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.