Re: [Matplotlib-users] Possible bug with saving eps figure
Filipe Pires Alvarenga Fernandes ocefpaf@... writes: Yep, that's what I was expecting. It should fail with both show() and the save as 'png' format. However, it only fails when trying to save an 'eps' -Filipe On Mon, May 7, 2012 at 1:12 PM, Benjamin Root ben.root at ou.edu wrote: On Mon, May 7, 2012 at 12:55 PM, Michael Droettboom mdroe at stsci.edu wrote: That's not a bug. linewidth is required to be a float, rather than a string. Python's typing is generally a little stricter than languages such as JavaScript. Mike I think the bigger question is why does it _work_ with show()? I would expect it to fail. I would rather have it fail everywhere or work everywhere. Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I came upon this thread after a lot of time messing with savefig. I was trying to get images in some vector format and was specifying linewidth as a string. Thanks to this thread, I have my images. However, some things I noticed were: (1) This error message only appeared when I tried to save as eps; not for pdf (my preference) or svg. (2) Shouldn't the exception or warning be raised when the plot call is made (for me it was bar(...)) ? (3) using pdf and svg with savefig raised no error. However, the resulting images were corrupted. Weirdly, in the case of pdf, the only pdf reader I tried not able to render the image correctly was adobe acrobat. Even the browser plugin for adobe could do it. In the case of svg, I opened the image in imagemagick but it did not look much like it should have. -- Try New Relic Now We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Possible bug with saving eps figure
Hi, this is not a big deal, but I think that there is a bug while saving eps figures and passing the linewidth='2.5' as string instead of float. The following reproduces the error I get here: plt.plot([1,2,3], 'k', linewidth='2.5') plt.savefig('teste.png') # Saves OK # The following fails with linewidth='2.5', but passes with linewidth=2.5 # TypeError: float argument required, not str plt.savefig('teste.eps') plt.show() # show is OK for both cases. matplotlib.__version__ Out[2]: '1.2.x' -Filipe -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Possible bug with saving eps figure
That's not a bug. linewidth is required to be a float, rather than a string. Python's typing is generally a little stricter than languages such as JavaScript. Mike On 05/07/2012 12:14 PM, Filipe Pires Alvarenga Fernandes wrote: Hi, this is not a big deal, but I think that there is a bug while saving eps figures and passing the linewidth='2.5' as string instead of float. The following reproduces the error I get here: plt.plot([1,2,3], 'k', linewidth='2.5') plt.savefig('teste.png') # Saves OK # The following fails with linewidth='2.5', but passes with linewidth=2.5 # TypeError: float argument required, not str plt.savefig('teste.eps') plt.show() # show is OK for both cases. matplotlib.__version__ Out[2]: '1.2.x' -Filipe -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Possible bug with saving eps figure
On Mon, May 7, 2012 at 12:55 PM, Michael Droettboom md...@stsci.edu wrote: That's not a bug. linewidth is required to be a float, rather than a string. Python's typing is generally a little stricter than languages such as JavaScript. Mike I think the bigger question is why does it _work_ with show()? I would expect it to fail. I would rather have it fail everywhere or work everywhere. Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Possible bug with saving eps figure
Yep, that's what I was expecting. It should fail with both show() and the save as 'png' format. However, it only fails when trying to save an 'eps' -Filipe On Mon, May 7, 2012 at 1:12 PM, Benjamin Root ben.r...@ou.edu wrote: On Mon, May 7, 2012 at 12:55 PM, Michael Droettboom md...@stsci.edu wrote: That's not a bug. linewidth is required to be a float, rather than a string. Python's typing is generally a little stricter than languages such as JavaScript. Mike I think the bigger question is why does it _work_ with show()? I would expect it to fail. I would rather have it fail everywhere or work everywhere. Ben Root -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users