I want to have bold labels on my axis, so I can use the plot to publish. I also need to have a line label in the legend in bold. For now, I can set the axis labels and legend for the size and weight I want. I can also set the size of the axis labels for the size I want, however I fail with the weight.
Here is a sample code:
from pylab import *
from matplotlib import rc
if __name__=='__main__':
tmpData = np.random.random( 100 )
rc('text', usetex=True)
rc('axes', linewidth=2)
rc('font', weight='bold')
f = figure(figsize=(10,10))
ax = gca()
plot(np.arange(100), tmpData, label=r'\textbf{Line 1}', linewidth=2)
ylabel(r'\textbf{Y-AXIS}', fontsize=20)
xlabel(r'\textbf{X-AXIS}', fontsize=20)
fontsize = 20
fontweight = 'bold'
fontproperties = {'family':'sans-serif','sans-serif':['Helvetica'],'weight' : fontweight, 'size' : fontsize}
ax.set_xticklabels(ax.get_xticks(), fontproperties)
ax.set_yticklabels(ax.get_yticks(), fontproperties)
for tick in ax.xaxis.get_major_ticks():
tick.label1.set_fontsize(fontsize)
for tick in ax.yaxis.get_major_ticks():
tick.label1.set_fontsize(fontsize)
legend()
show()
sys.exit()
And here is what I get:

Any idea what I am missing or something is wrong to highlight the axis labels in bold?
EDIT
, toms. , datetime x, , y ( , , , ):
from pylab import *
from matplotlib import rc, rcParams
import matplotlib.dates as dates
import datetime
if __name__=='__main__':
tmpData = np.random.random( 100 )
base = datetime.datetime(2000, 1, 1)
arr = np.array([base + datetime.timedelta(days=i) for i in xrange(100)])
rc('text', usetex=True)
rc('axes', linewidth=2)
rc('font', weight='bold')
rcParams['text.latex.preamble'] = [r'\usepackage{sfmath} \boldmath']
f = figure(figsize=(10,10))
ax = gca()
plot(np.arange(100), tmpData, label=r'\textbf{Line 1}', linewidth=2)
ylabel(r'\textbf{Y-AXIS}', fontsize=20)
xlabel(r'\textbf{X-AXIS}', fontsize=20)
ax.xaxis.set_tick_params(labelsize=20)
ax.yaxis.set_tick_params(labelsize=20)
ax.xaxis.set_major_formatter(dates.DateFormatter('%m/%Y'))
ax.xaxis.set_major_locator(dates.MonthLocator(interval=1))
legend()
:

, , , x-axis.