better way to change spine and ticklabel colors?

Hi all,

I’ve really been enjoying matplotlib, but in getting my graphs to look just the way I want, I find myself having to just through some hoops to get there.

my question is: is there a better way of changing spine, tick, and ticklabels colors?

Here’s what I use right now:

[s.set_color(color) for s in ax.spines.values()]
[s.set_color(color) for s in ax.yaxis.get_ticklines()]
[s.set_color(color) for s in ax.xaxis.get_ticklines()]
[(s.set_color(color),s.set_size(8)) for s in ax.xaxis.get_ticklabels()]
[(s.set_color(color),s.set_size(8)) for s in ax.yaxis.get_ticklabels()]
ax.yaxis.grid(which='major',linestyle='-',color=color,alpha=.3)

I realize that I should probably set the rcParam equivalents before creating ax. But once I have an axesSubplot ax, what’s the best way to fiddle with these parameters?

you can see a full example here:
http://pirsquared.org/blog/2010/06/07/ca-prop/

best,
Paul Ivanov

···


I only use the 314 gmail account for mailinglists. Please send off-list personal correspondence to my initials (two letters) at berkeley dot edu.

I would like to second this sentiment. I just encountered a situation today where I needed to modify the fontsize of the ticklabels and I could not find any obvious method for modifying the properties. Unless I am mistaken and there are methods for this, shall I file a feature request?

Ben Root

···

On Mon, Jun 7, 2010 at 7:55 PM, Paul Ivanov <pivanov314@…287…> wrote:

Hi all,

I’ve really been enjoying matplotlib, but in getting my graphs to look just the way I want, I find myself having to just through some hoops to get there.

my question is: is there a better way of changing spine, tick, and ticklabels colors?

Here’s what I use right now:

[s.set_color(color) for s in ax.spines.values()]
[s.set_color(color) for s in ax.yaxis.get_ticklines()]
[s.set_color(color) for s in ax.xaxis.get_ticklines()]



[(s.set_color(color),s.set_size(8)) for s in ax.xaxis.get_ticklabels()]
[(s.set_color(color),s.set_size(8)) for s in ax.yaxis.get_ticklabels()]
ax.yaxis.grid(which='major',linestyle='-',color=color,alpha=.3)

I realize that I should probably set the rcParam equivalents before creating ax. But once I have an axesSubplot ax, what’s the best way to fiddle with these parameters?

you can see a full example here:

http://pirsquared.org/blog/2010/06/07/ca-prop/

best,
Paul Ivanov


I only use the 314 gmail account for mailinglists. Please send off-list personal correspondence to my initials (two letters) at berkeley dot edu.


ThinkGeek and WIRED’s GeekDad team up for the Ultimate

GeekDad Father’s Day Giveaway. ONE MASSIVE PRIZE to the

lucky parental unit. See the prize list and enter to win:

http://p.sf.net/sfu/thinkgeek-promo


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

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

I would like to second this sentiment. I just encountered a situation
today where I needed to modify the fontsize of the ticklabels and I
could not find any obvious method for modifying the properties. Unless
I am mistaken and there are methods for this, shall I file a feature
request?

I'm already working on it, and have the low level parts done. I just have to put in the higher-level API and commit it.

Eric

···

On 06/07/2010 04:31 PM, Benjamin Root wrote:

Ben Root

On Mon, Jun 7, 2010 at 7:55 PM, Paul Ivanov <pivanov314@…287… > <mailto:pivanov314@…287…>> wrote:

    Hi all,

    I've really been enjoying matplotlib, but in getting my graphs to
    look just the way I want, I find myself having to just through some
    hoops to get there.

    my question is: is there a better way of changing spine, tick, and
    ticklabels colors?

    Here's what I use right now:

         [s.set_color(color) for s in ax.spines.values()]
         [s.set_color(color) for s in ax.yaxis.get_ticklines()]
         [s.set_color(color) for s in ax.xaxis.get_ticklines()]
         [(s.set_color(color),s.set_size(8)) for s in
    ax.xaxis.get_ticklabels()]
         [(s.set_color(color),s.set_size(8)) for s in
    ax.yaxis.get_ticklabels()]
         ax.yaxis.grid(which='major',linestyle='-',color=color,alpha=.3)

    I realize that I should probably set the rcParam equivalents before
    creating ax. But once I have an axesSubplot ax, what's the best way
    to fiddle with these parameters?

    you can see a full example here:
    http://pirsquared.org/blog/2010/06/07/ca-prop/

    best,
    Paul Ivanov

    --
    I only use the 314 gmail account for mailinglists. Please send
    off-list personal correspondence to my initials (two letters) at
    berkeley dot edu.

    ------------------------------------------------------------------------------
    ThinkGeek and WIRED's GeekDad team up for the Ultimate
    GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
    lucky parental unit. See the prize list and enter to win:
    http://p.sf.net/sfu/thinkgeek-promo
    _______________________________________________
    Matplotlib-users mailing list
    Matplotlib-users@lists.sourceforge.net
    <mailto:Matplotlib-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users