[Matplotlib-users] WebP support

2010-10-02 Thread Nils Wagner
Hi all,

just curious - is the WebP format supported by matplotlib 
?

Nils


http://code.google.com/intl/de-DE/speed/webp/

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Jouni K . Seppänen
"Nils Wagner"  writes:

> just curious - is the WebP format supported by matplotlib 

No. It seems to be a method for lossy compression of photographs and
therefore not likely to be useful for line drawings - or what did you
have in mind?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow() and a transparent colormap?

2010-10-02 Thread Nicolas Bigaouette
On Fri, Oct 1, 2010 at 5:38 PM, Stan West  wrote:

>  *From:* Nicolas Bigaouette [mailto:nbigaoue...@gmail.com]
> *Sent:* Thursday, September 30, 2010 18:00
>
> What I would like to do it have a colormap which is transparent for lower
> values of data and opaque for high values, so the blue on the figure would
> appear white/transparent.
>
> Would it suffice for the colormap to be light or white for low values but
> still opaque? There are several built-in maps [1] with a light color at one
> end; if it's light at the high end, append "_r" to the colormap name to get
> the reversed version.
>
> [1]
> http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html
>
I guess it's the best solution for now. Thanks ;)
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Benjamin Root
On Sat, Oct 2, 2010 at 7:28 AM, Jouni K. Seppänen  wrote:

> "Nils Wagner"  writes:
>
> > just curious - is the WebP format supported by matplotlib
>
> No. It seems to be a method for lossy compression of photographs and
> therefore not likely to be useful for line drawings - or what did you
> have in mind?
>
> --
> Jouni K. Seppänen
> http://www.iki.fi/jks
>
>
>
And yet, we still allow for saving to jpegs.  Also, matplotlib is also able
to do imshow(), pcolor() and other rasterized drawings, so we aren't
restricted to just line drawings.

Nils, the answer is "no, we don't support webp -- yet".  There is no reason
why we can't eventually do so, and patches will always be welcomed.  I just
wouldn't expect it anytime soon.

Ben Root
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow() and a transparent colormap?

2010-10-02 Thread Benjamin Root
On Sat, Oct 2, 2010 at 10:37 AM, Nicolas Bigaouette
wrote:

> On Fri, Oct 1, 2010 at 5:38 PM, Stan West  wrote:
>
>>  *From:* Nicolas Bigaouette [mailto:nbigaoue...@gmail.com]
>> *Sent:* Thursday, September 30, 2010 18:00
>>
>> What I would like to do it have a colormap which is transparent for lower
>> values of data and opaque for high values, so the blue on the figure would
>> appear white/transparent.
>>
>> Would it suffice for the colormap to be light or white for low values but
>> still opaque? There are several built-in maps [1] with a light color at one
>> end; if it's light at the high end, append "_r" to the colormap name to get
>> the reversed version.
>>
>> [1]
>> http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html
>>
> I guess it's the best solution for now. Thanks ;)
>
>
>
Nicolas,

It would be extremely useful if you could file a feature request for this at
our tracker:

http://sourceforge.net/tracker/?atid=560723&group_id=80706&func=browse

This way, your suggestion won't get lost.

Ben Root
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Darren Dale
On Sat, Oct 2, 2010 at 11:58 AM, Benjamin Root  wrote:
> On Sat, Oct 2, 2010 at 7:28 AM, Jouni K. Seppänen  wrote:
>>
>> "Nils Wagner"  writes:
>>
>> > just curious - is the WebP format supported by matplotlib
>>
>> No. It seems to be a method for lossy compression of photographs and
>> therefore not likely to be useful for line drawings - or what did you
>> have in mind?
>
> And yet, we still allow for saving to jpegs.

Only some of the non-agg backends support saving to jpegs. Whenever
someone posts to the list asking why jpegs are not supported, the
answer is that, aside from not being supported by agg, lossy formats
like jpeg are a poor choice for saving line art.

Darren

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Benjamin Root
On Sat, Oct 2, 2010 at 11:54 AM, Darren Dale  wrote:

> On Sat, Oct 2, 2010 at 11:58 AM, Benjamin Root  wrote:
> > On Sat, Oct 2, 2010 at 7:28 AM, Jouni K. Seppänen  wrote:
> >>
> >> "Nils Wagner"  writes:
> >>
> >> > just curious - is the WebP format supported by matplotlib
> >>
> >> No. It seems to be a method for lossy compression of photographs and
> >> therefore not likely to be useful for line drawings - or what did you
> >> have in mind?
> >
> > And yet, we still allow for saving to jpegs.
>
> Only some of the non-agg backends support saving to jpegs. Whenever
> someone posts to the list asking why jpegs are not supported, the
> answer is that, aside from not being supported by agg, lossy formats
> like jpeg are a poor choice for saving line art.
>
>
Heh, I never noticed that.  On this computer, I use TkAgg, and it worked
just fine.  Admittedly, I haven't tried this out much because I usually use
png or one of the vector-based formats.

Ben Root
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Jouni K . Seppänen
Benjamin Root  writes:

> And yet, we still allow for saving to jpegs.

Wow, I didn't know. Last time I tried that I got a traceback, and
assumed that it was not supported exactly because jpeg is a nonsensical
format for most graphs.

I just tried again, and got "TypeError: 'int' object is unsubscriptable"
from PIL/JpegImagePlugin.pyc in _save(im, fp, filename). I suppose this
doesn't get much testing.

> Also, matplotlib is also able to do imshow(), pcolor() and other
> rasterized drawings, so we aren't restricted to just line drawings.

Yes, I guess there are some circumstances in which this would make
sense. Would supporting WebP require new library dependencies?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] postscript fonts: examples in matplotlib

2010-10-02 Thread Ed Lazarus
All,

I am wondering if anyone knows of a working example that yields
a postscript figure editable in Adobe Illustrator; that is, the characters are 
editable as characters. 
I have only been able to get drawn fonts and would love to have a test case 
that is known  to work.

My environment is:
> python
Python 2.6.6 (r266:84292, Sep 11 2010, 15:25:14) 
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__ 
'1.0.0'
>>> matplotlib.__file__
'/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/__init__.pyc'
>>> 
my rc file is:
backend : TkAgg # the default backend
interactive : True
ps.usedistiller : xpdf

I can produce postscript fonts outside python, say in IDL.
I can produce postscript fonts in python using the psg package, but not 
matplotlib. 
In all the examples at http://matplotlib.sourceforge.net/ I did not find 
anything that
explicitly addresses this issue.

Thanks to anyone who answers with a test case.

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Benjamin Root
On Sat, Oct 2, 2010 at 12:39 PM, Jouni K. Seppänen  wrote:

> Benjamin Root  writes:
>
> > And yet, we still allow for saving to jpegs.
>
> Wow, I didn't know. Last time I tried that I got a traceback, and
> assumed that it was not supported exactly because jpeg is a nonsensical
> format for most graphs.
>
> I just tried again, and got "TypeError: 'int' object is unsubscriptable"
> from PIL/JpegImagePlugin.pyc in _save(im, fp, filename). I suppose this
> doesn't get much testing.
>
>
Yeah, I just double-checked which backend I was using and it turned out to
be GTKAgg (I forgot that I changed it at one point for a test).  In TkAgg, I
get the same error message you report.


> > Also, matplotlib is also able to do imshow(), pcolor() and other
> > rasterized drawings, so we aren't restricted to just line drawings.
>
> Yes, I guess there are some circumstances in which this would make
> sense. Would supporting WebP require new library dependencies?
>
> --
> Jouni K. Seppänen
> http://www.iki.fi/jks
>
>
I am certainly not an expert, but it would appear that we offload a lot of
the file-format stuff to PIL anyway.  So, if PIL ever supports WebP, then I
would imagine (although I could be wrong) that it would be fairly trivial to
add support to WebP at least to whereever we support JPEG.

Ben Root
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Gaius Hammond
It's really not clear to me why we would want to lower the quality of our 
graphs to save Google's bandwidth bills. Because that's all this is...



Cheers,



G




--

-Original Message-
From: "Nils Wagner" 
Date: Sat, 02 Oct 2010 12:59:12 
To: 
Subject: [Matplotlib-users] WebP support

Hi all,

just curious - is the WebP format supported by matplotlib 
?

Nils


http://code.google.com/intl/de-DE/speed/webp/

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] WebP support

2010-10-02 Thread Daπid
On Sat, Oct 2, 2010 at 7:39 PM, Jouni K. Seppänen  wrote:
>> And yet, we still allow for saving to jpegs.
>
> Wow, I didn't know. Last time I tried that I got a traceback, and
> assumed that it was not supported exactly because jpeg is a nonsensical
> format for most graphs.

Don't forget MPL is also capable of dealing with photographs, and it
is really useful. I am currently working in two scientific projects
based on this capability, and for some issues could be useful to save
JPGs.

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users