[matplotlib-devel] Animation class: let save() accept **kwargs which are passed on to savefig()?

2012-10-31 Thread Maximilian Albert
[I sent this email a few weeks ago already, but I wasn't subscribed to
matplotlib-devel at the time and it seems that the message was never
approved by the moderator. So here comes my second attempt. :)]

Hi all,

this is my first post to this mailing list, so let me take the
opportunity to thank everyone involved for an amazing piece of
software and all the hard work you guys put into it! It is very much
appreciated indeed.

I have a quick question/suggestion regarding the save() method in the
matplotlib.animation.Animation class. I recently produced an animation
in which I needed to set tight bounding boxes when saving the
individual frames. Obviously savefig() supports this, but there is no
way to pass this information to the Animation.save() method. Would it
make sense to let Animation.save() accept additional keyword arguments
which are simply passed on to savefig() in each step of the animation
loop? Or am I overlooking potential drawbacks of this approach? A
simple patch with this idea is attached. Feel free to use it as is or
to modify at will if you think this is useful.

Many thanks and kind regards,
Max


0001-Allow-Animation.save-to-accept-keyword-arguments-whi.patch
Description: Binary data
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Animation class: let save() accept **kwargs which are passed on to savefig()?

2012-10-31 Thread Damon McDougall
On Wed, Oct 31, 2012 at 7:04 AM, Maximilian Albert
 wrote:
> [I sent this email a few weeks ago already, but I wasn't subscribed to
> matplotlib-devel at the time and it seems that the message was never
> approved by the moderator. So here comes my second attempt. :)]
>
> Hi all,
>
> this is my first post to this mailing list, so let me take the
> opportunity to thank everyone involved for an amazing piece of
> software and all the hard work you guys put into it! It is very much
> appreciated indeed.
>
> I have a quick question/suggestion regarding the save() method in the
> matplotlib.animation.Animation class. I recently produced an animation
> in which I needed to set tight bounding boxes when saving the
> individual frames. Obviously savefig() supports this, but there is no
> way to pass this information to the Animation.save() method. Would it
> make sense to let Animation.save() accept additional keyword arguments
> which are simply passed on to savefig() in each step of the animation
> loop? Or am I overlooking potential drawbacks of this approach? A
> simple patch with this idea is attached. Feel free to use it as is or
> to modify at will if you think this is useful.
>
> Many thanks and kind regards,
> Max

Hi Max,

Sounds like a great idea! Would you feel comfortable having a go at an
implementation? You can make a pull request out of it. The rest of the
developers can then deliberate and provide feedback for you.

Best wishes,
Damon

-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Animation class: let save() accept **kwargs which are passed on to savefig()?

2012-10-31 Thread Maximilian Albert
Hi Damon,

many thanks for the quick (and positive :)) reply,

> Sounds like a great idea! Would you feel comfortable having a go at an
> implementation? You can make a pull request out of it. The rest of the
> developers can then deliberate and provide feedback for you.

I attached a patch to my previous email which contains an
implementation, but perhaps it didn't make it through to the list? But
since I had to clone the git repository anyway to implement it, I'm
happy to make a pull request, too. I'll have to find out how to do
that since I've never done it before, but I guess it can't be too
difficult. Will give it a shot later today.

Thanks again and best regards,
Max

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Animation class: let save() accept **kwargs which are passed on to savefig()?

2012-10-31 Thread Damon McDougall
On Wed, Oct 31, 2012 at 7:40 AM, Maximilian Albert
 wrote:
> Hi Damon,
>
> many thanks for the quick (and positive :)) reply,
>
>> Sounds like a great idea! Would you feel comfortable having a go at an
>> implementation? You can make a pull request out of it. The rest of the
>> developers can then deliberate and provide feedback for you.
>
> I attached a patch to my previous email which contains an
> implementation, but perhaps it didn't make it through to the list? But
> since I had to clone the git repository anyway to implement it, I'm
> happy to make a pull request, too. I'll have to find out how to do
> that since I've never done it before, but I guess it can't be too
> difficult. Will give it a shot later today.

You need to fork the main matplotlib repo, so you have your own copy
associated with your github account:
https://help.github.com/articles/fork-a-repo

Once you've forked it, clone it and create a branch:

git clone my-forked-repo-url
cd matplotlib
git checkout -b my_awesome_new_feature
# ... hack hack hack ...
git commit -am "Useful commit message here"
git push origin my_awesome_new_feature

Once you've done that, make a pull request by following the
instructions here:
https://help.github.com/articles/using-pull-requests

Once you've done that, congratulations!

Hope this helps.
Best wishes,
Damon

-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Animation class: let save() accept **kwargs which are passed on to savefig()?

2012-10-31 Thread Eric Firing
On 2012/10/31 2:04 AM, Maximilian Albert wrote:
> [I sent this email a few weeks ago already, but I wasn't subscribed to
> matplotlib-devel at the time and it seems that the message was never
> approved by the moderator. So here comes my second attempt. :)]
>
> Hi all,
>
> this is my first post to this mailing list, so let me take the
> opportunity to thank everyone involved for an amazing piece of
> software and all the hard work you guys put into it! It is very much
> appreciated indeed.
>
> I have a quick question/suggestion regarding the save() method in the
> matplotlib.animation.Animation class. I recently produced an animation
> in which I needed to set tight bounding boxes when saving the
> individual frames. Obviously savefig() supports this, but there is no
> way to pass this information to the Animation.save() method. Would it
> make sense to let Animation.save() accept additional keyword arguments
> which are simply passed on to savefig() in each step of the animation
> loop? Or am I overlooking potential drawbacks of this approach? A
> simple patch with this idea is attached. Feel free to use it as is or
> to modify at will if you think this is useful.

I don't have time to look at this, so I will toss out one idea for 
consideration:

If there is any chance that other sorts of kwarg collections might be 
needed, or simply to improve readability and explicitness, instead of 
passing on **kwargs, you might make a new kwarg, "savefigkw", which 
would take a dictionary that would then be used via "savefig(..., 
**savefigkw".

Eric


>
> Many thanks and kind regards,
> Max
>
>
>
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
>
>
>
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>



--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Animation class: let save() accept **kwargs which are passed on to savefig()?

2012-10-31 Thread Jens Nielsen
I think Eric idea is a good solution. This is just to point out that I did
something similar
with kw args to savefig in the image comparison decorator for tests.  See
the changes in
decorators.py in this pull request
https://github.com/matplotlib/matplotlib/pull/1420 . Seems to work fine.

Greetings, Jens


On Wed, Oct 31, 2012 at 4:22 PM, Eric Firing  wrote:

> On 2012/10/31 2:04 AM, Maximilian Albert wrote:
> > [I sent this email a few weeks ago already, but I wasn't subscribed to
> > matplotlib-devel at the time and it seems that the message was never
> > approved by the moderator. So here comes my second attempt. :)]
> >
> > Hi all,
> >
> > this is my first post to this mailing list, so let me take the
> > opportunity to thank everyone involved for an amazing piece of
> > software and all the hard work you guys put into it! It is very much
> > appreciated indeed.
> >
> > I have a quick question/suggestion regarding the save() method in the
> > matplotlib.animation.Animation class. I recently produced an animation
> > in which I needed to set tight bounding boxes when saving the
> > individual frames. Obviously savefig() supports this, but there is no
> > way to pass this information to the Animation.save() method. Would it
> > make sense to let Animation.save() accept additional keyword arguments
> > which are simply passed on to savefig() in each step of the animation
> > loop? Or am I overlooking potential drawbacks of this approach? A
> > simple patch with this idea is attached. Feel free to use it as is or
> > to modify at will if you think this is useful.
>
> I don't have time to look at this, so I will toss out one idea for
> consideration:
>
> If there is any chance that other sorts of kwarg collections might be
> needed, or simply to improve readability and explicitness, instead of
> passing on **kwargs, you might make a new kwarg, "savefigkw", which
> would take a dictionary that would then be used via "savefig(...,
> **savefigkw".
>
> Eric
>
>
> >
> > Many thanks and kind regards,
> > Max
> >
> >
> >
> >
> --
> > Everyone hates slow websites. So do we.
> > Make your web apps faster with AppDynamics
> > Download AppDynamics Lite for free today:
> > http://p.sf.net/sfu/appdyn_sfd2d_oct
> >
> >
> >
> > ___
> > Matplotlib-devel mailing list
> > Matplotlib-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> >
>
>
>
>
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] colorbar edges in white for PDF output

2012-10-31 Thread Nicolas Rougier

I confirm on 1.2.x. on OSX 10.7.5.

Nicolas


On Oct 31, 2012, at 17:20 , Andrew Dawson wrote:

> Hi all,
> 
> I just noticed that colorbar edges are drawn in white when output in PDF and 
> black when output in PNG. A small test script is attached along with the 
> output to show the difference.
> 
> I'd be interested in knowing if others can reproduce this? I'm using 
> mpl-1.3.x (updated 5 minutes ago) on 64-bit Ubuntu 12.04.
> 
> Cheers,
> Andrew
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Animation class: let save() accept **kwargs which are passed on to savefig()?

2012-10-31 Thread Maximilian Albert
Awesome, many thanks for the detailed instructions, as well as for the
valuable suggestions by Eric and Jens. I have now created a pull
request containing the proposed change, including the suggested
modifications:

   https://github.com/matplotlib/matplotlib/pull/1442

Any comments/feedback would be much appreciated.

Best wishes,
Max


2012/10/31 Damon McDougall :
> On Wed, Oct 31, 2012 at 7:40 AM, Maximilian Albert
>  wrote:
>> Hi Damon,
>>
>> many thanks for the quick (and positive :)) reply,
>>
>>> Sounds like a great idea! Would you feel comfortable having a go at an
>>> implementation? You can make a pull request out of it. The rest of the
>>> developers can then deliberate and provide feedback for you.
>>
>> I attached a patch to my previous email which contains an
>> implementation, but perhaps it didn't make it through to the list? But
>> since I had to clone the git repository anyway to implement it, I'm
>> happy to make a pull request, too. I'll have to find out how to do
>> that since I've never done it before, but I guess it can't be too
>> difficult. Will give it a shot later today.
>
> You need to fork the main matplotlib repo, so you have your own copy
> associated with your github account:
> https://help.github.com/articles/fork-a-repo
>
> Once you've forked it, clone it and create a branch:
>
> git clone my-forked-repo-url
> cd matplotlib
> git checkout -b my_awesome_new_feature
> # ... hack hack hack ...
> git commit -am "Useful commit message here"
> git push origin my_awesome_new_feature
>
> Once you've done that, make a pull request by following the
> instructions here:
> https://help.github.com/articles/using-pull-requests
>
> Once you've done that, congratulations!
>
> Hope this helps.
> Best wishes,
> Damon
>
> --
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel