'How to change text color in Matplotlib?

How to change the color of a matplotlib graph? Now the title is black but the other texts are grey. I'm creating a Hexbin graph using Pandas plot. I have already tried

matplotlib.rcParams.update({'text.color': 'black'})

As I understood from http://matplotlib.org/users/customizing.html But it doesn't work.

import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot')
font = {'family' : 'normal',
        'weight' : 'bold',
        'size'   : 22}                          
matplotlib.rc('font', **font)

t = pessoas.plot.hexbin(x='qteViagens',y='qteDestUnicos',cmap=plt.cm.jet,gridsize=20,norm=matplotlib.colors.LogNorm(),colorbar=False)
t.set_xlabel('Number of Trips in Period')
t.set_ylabel('Number of Unique Destinations')
t.set_title('Number of Users')

Matplotlib Hexbin graph



Solution 1:[1]

In order to change the color of the axis one might do

axes.xaxis.label.set_color("yellow")

axes.yaxis.label.set_color("green")

enter image description here

Alternatively, one can pass the color of the labels when creating them with matplotlib.axes.Axes.set_xlabel, such as

ax.set_xlabel('Number of Trips in Period', color='yellow') 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gonçalo Peres