Setting default labelpad

Finally made this into a patch to allow the dynamic updating of the axes.labelpad parameter.
Hope this is in the appropriate format!

Thanks,

– Peter

0001-BF-added-options-for-axes.labelpad-in-matplotlibrc.patch (1.54 KB)

···

On Mon, Oct 28, 2013 at 10:45 AM, Peter St. John <peterc.stjohn@…149…> wrote:

Hi Matplotlib-users,

I found it was useful to be able to change the default ‘Axis.labelpad’ parameter, since this value didn’t scale when changing the default figure size (in my opinion its easier to prepare figures for publication assuming they’ll need to fit in a 1-column figure). I don’t consider myself experienced enough to attempt to contribute a patch, but nevertheless here is the hack I used in case anyone has a similar problem:

axis.py, line 652:

original: self.labelpad = 5
changed : self.labelpad = rcParams[‘axes.labelpad’]

Then, in rcsetup.py, I added the line (at 578):

'axes.labelpad' :        [5.0, validate_float], 

This lets you put

axes.labelpad : 3

for instance, in your matplotlibrc to change the default label padding.

Anyways, not sure if this is the right mailing list for this type of thing, but just thought I’d contribute it nevertheless.

Best,

– Peter

Peter,

Can you submit this as a pull request on github?

http://matplotlib.org/devel/gitwash/git_development.html

···

On Fri, May 30, 2014 at 12:37 PM, Peter St. John <peterc.stjohn@…322…9…> wrote:

Finally made this into a patch to allow the dynamic updating of the axes.labelpad parameter.
Hope this is in the appropriate format!

Thanks,

– Peter


Time is money. Stop wasting it! Get your web API in 5 minutes.

www.restlet.com/download

http://p.sf.net/sfu/restlet


Matplotlib-devel mailing list

Matplotlib-devel@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

On Mon, Oct 28, 2013 at 10:45 AM, Peter St. John <peterc.stjohn@…149…> wrote:

Hi Matplotlib-users,

I found it was useful to be able to change the default ‘Axis.labelpad’ parameter, since this value didn’t scale when changing the default figure size (in my opinion its easier to prepare figures for publication assuming they’ll need to fit in a 1-column figure). I don’t consider myself experienced enough to attempt to contribute a patch, but nevertheless here is the hack I used in case anyone has a similar problem:

axis.py, line 652:

original: self.labelpad = 5
changed : self.labelpad = rcParams[‘axes.labelpad’]

Then, in rcsetup.py, I added the line (at 578):

'axes.labelpad' :        [5.0, validate_float], 

This lets you put

axes.labelpad : 3

for instance, in your matplotlibrc to change the default label padding.

Anyways, not sure if this is the right mailing list for this type of thing, but just thought I’d contribute it nevertheless.

Best,

– Peter

Sure, here it is:

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

···

On Fri, May 30, 2014 at 4:21 PM, Paul Hobson <pmhobson@…149…> wrote:

Peter,

Can you submit this as a pull request on github?

http://matplotlib.org/devel/gitwash/git_development.html

On Fri, May 30, 2014 at 12:37 PM, Peter St. John <peterc.stjohn@…149…> wrote:

Finally made this into a patch to allow the dynamic updating of the axes.labelpad parameter.
Hope this is in the appropriate format!

Thanks,

– Peter


Time is money. Stop wasting it! Get your web API in 5 minutes.

www.restlet.com/download

http://p.sf.net/sfu/restlet


Matplotlib-devel mailing list

Matplotlib-devel@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

On Mon, Oct 28, 2013 at 10:45 AM, Peter St. John <peterc.stjohn@…149…> wrote:

Hi Matplotlib-users,

I found it was useful to be able to change the default ‘Axis.labelpad’ parameter, since this value didn’t scale when changing the default figure size (in my opinion its easier to prepare figures for publication assuming they’ll need to fit in a 1-column figure). I don’t consider myself experienced enough to attempt to contribute a patch, but nevertheless here is the hack I used in case anyone has a similar problem:

axis.py, line 652:

original: self.labelpad = 5
changed : self.labelpad = rcParams[‘axes.labelpad’]

Then, in rcsetup.py, I added the line (at 578):

'axes.labelpad' :        [5.0, validate_float], 

This lets you put

axes.labelpad : 3

for instance, in your matplotlibrc to change the default label padding.

Anyways, not sure if this is the right mailing list for this type of thing, but just thought I’d contribute it nevertheless.

Best,

– Peter