Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matplotlib: set title color in stylesheet

I am setting a custom stylesheet in mpl. I found and modified some example settings online:

axes.titlesize  : 18
axes.labelsize  : large
axes.labelcolor : ffffff

I also want to change the font color of the title. From these settings, axes.titlecolor seemed like a good guess, but it doesn't work. Any ideas on how to do this?

like image 208
Christopher Brown Avatar asked May 07 '15 18:05

Christopher Brown


1 Answers

Try using

# Sets title color
text.color = 'your_color'

# Sets other chart attribute colors
xtick.color = 'your_color'
ytick.color = 'your_color'
axes.labelcolor = 'your_color'

Printing out mpl.rcParams.keys() gives you a list of attributes that you can adjust.

Example:

import matplotlib as mpl

mpl.rcParams['text.color'] = 'w'
mpl.rcParams['xtick.color'] = 'w'
mpl.rcParams['ytick.color'] = 'w'
mpl.rcParams['axes.labelcolor'] = 'w'

Source: https://matplotlib.org/users/customizing.html

like image 174
M.Cush Avatar answered Sep 20 '22 08:09

M.Cush