本文整理汇总了Python中matplotlib.pylab.rc函数的典型用法代码示例。如果您正苦于以下问题:Python rc函数的具体用法?Python rc怎么用?Python rc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: display_TwoHopSchemes
def display_TwoHopSchemes(two_hop_schemes, pathString):
'''
Produce a graph that compare ...
'''
self = two_hop_schemes
pylab.rc('axes', linewidth=2) # make the axes boundary lines bold
#fig, ax = plt.subplots()
fig = plt.figure()
ax = fig.add_axes([0.1, 0.1, 0.7, 0.7]) # left, bottom, width, height (range 0 to 1)
rr.plot( self.region_CF_ICFsch3, 'red', lw=8, axes=ax, label='CF + ICF')
rr.plot( self.region_DFIntegerCoeff_FCo, 'c', lw=4, axes=ax, label='DF + FCo')
rr.plot( self.region_noInterference, 'blue', lw=2, axes=ax, label='Free Interf.')
fig.suptitle('$g ={},{},{},{}$'.format(self.g13, self.g14, self.g23, self.g24), fontsize=14, fontweight='bold')
ax.set_title(r'$P_s=P_1=P_2={}, \, P_3={}, \, P_4={}, \, N=1$'.format(self.Ps, self.P3, self.P4),fontdict=self.font)
ax.set_xlabel('$R_1$', fontdict=self.font)
ax.set_ylabel('$R_2$', fontdict=self.font)
#ax.set_xlim(xmin=0, xmax=3.5)
#ax.set_ylim(ymin=0, ymax=3.5)
ax.legend(loc=0)
# savefig.save(path='{}compare_TwoHop_Schemes/PsP3P4_{}_{}_{}_g_{}_{}_{}_{}'.format(pathString, self.Ps, self.P3, self.P4, self.g13, self.g14, self.g23, self.g24), ext='pdf', close=False, verbose=True)
nameStr = 'PsP3P4_{}_{}_{}_g13g14g23g24_{}_{}_{}_{}'.format(self.Ps, self.P3, self.P4, self.g13, self.g14, self.g23, self.g24)
savefig.save(path='{}compare_TwoHop_Schemes/{}'.format(pathString, nameStr), ext='pdf', close=False, verbose=True)
示例2: display
def display(oneSimulation,pathString, separate=False ,saveOnly=True):
'''
show/save figures
'''
self = oneSimulation
pylab.rc('axes', linewidth=2) # make the axes boundary lines bold
#fig, ax = plt.subplots()
fig = plt.figure()
ax = fig.add_axes([0.1, 0.1, 0.7, 0.7]) # left, bottom, width, height (range 0 to 1)
if separate:
rr.plot( self.df_Region, 'red', lw=6, axes=ax, label='DF')
rr.plot( self.cf_Region, 'blue', lw=4, axes=ax, label='CF')
rr.plot( self.fco_Region, 'red', lw=6, axes=ax, label='DF')
rr.plot( self.icf_Region_bigR1, 'blue', lw=4, axes=ax, label='ICF')
rr.plot( self.icf_Region_bigR2, 'blue', lw=4, axes=ax)
rr.plot(self.df_fco_region, 'red', lw=6, label='DF+FCo')
rr.plot(self.cf_icf_region, 'blue', lw=4, label='CF+ICF')
fig.suptitle('$g ={},{},{},{}$'.format(self.g13, self.g14, self.g23, self.g24), fontsize=14, fontweight='bold')
ax.set_title(r'$P_s=P_1=P_2={}, \, P_3={}, \, P_4={}, \, N=1$'.format(self.Ps,
self.P3, self.P4),fontdict=self.font)
ax.set_xlabel('$R_1$', fontdict=self.font)
ax.set_ylabel('$R_2$', fontdict=self.font)
#ax.set_xlim(xmin=0, xmax=3.5)
#ax.set_ylim(ymin=0, ymax=3.5)
ax.legend(loc=0)
nameStr = 'PsP3P4_{}_{}_{}_g13g14g23g24_{}_{}_{}_{}'.format(self.Ps, self.P3, self.P4,
self.g13, self.g14, self.g23, self.g24)
savefig.save(path='{}/plots_CF_ICF__DF_FCo/{}'.format(pathString, nameStr), ext='pdf', close=saveOnly, verbose=True)
示例3: plot_transition_ratio
def plot_transition_ratio(df1, df2):
"""
plot stage transitions
df1: normal sleep (df1 = analyse(base))
df2: sleep depravation (df2 = analyse(depr))
"""
N = 5
ind = np.arange(N) # the x locations for the groups
width = 0.2 # he width of the bars
plt.close()
plt.rc('font', family='Arial')
fig, ax = plt.subplots(nrows=6, ncols=6, sharex='col', sharey='row')
fig.suptitle("Comparison of the number of stage transitions (% of total transitions) (origin stage " + u'\u2192' + " dest. stage)", fontsize=20)
plt.subplots_adjust(wspace = 0.2,hspace = 0.4 )
for i in range(0,6): # do not care about stage transitions > 5
for j in range(0,6):
clef = '%t' + str(i) + '-' + str(j)
normal = df1[clef].tolist()
mean = sum(normal) / len(normal)
normal.extend([mean])
rects1 = ax[i,j].bar(ind, normal, width, color='b')
depravation = df2[clef].tolist()
mean = sum(depravation) / len(depravation)
depravation.extend([mean])
rects2 = ax[i,j].bar(ind+width, depravation, width, color='r')
for label in (ax[i,j].get_xticklabels() + ax[i,j].get_yticklabels()):
label.set_fontname('Arial')
label.set_fontsize(8)
ax[i,j].set_title(str(i) + ' ' + u'\u2192' + ' ' + str(j))
ax[i,j].set_xticks(ind+width)
ax[i,j].set_xticklabels( ('1', '2', '3', '4', 'Avg') )
ax[i,j].set_yticks(np.arange(0, 6, 2))
ax[i,j].set_ylim([0,6])
fig.legend( (rects1[0], rects2[0]), ('Baseline', 'Recovery'), loc = 'lower right', fontsize=10)
示例4: newCreateAndSaveMultilineFig
def newCreateAndSaveMultilineFig(xDataList, yDataList, xLabel="", yLabel="",
figFileRoot="", fileExt='.png', xMin=0,
xMax=0, yMin=0, yMax=0, legendFlag=1,
legendFont=12, traceNameList=[],
legLoc=(0, 0)):
"""This subroutine saves a figure with multiple lines."""
figFileName = figFileRoot + fileExt
colorDict = createColorDictWithDashes()
if xMax == 0:
curMax = 0
for n in range(0, len(xDataList)):
if type(xDataList[n]) == list:
if max(xDataList[n]) > curMax:
curMax = max(xDataList[n])
else:
if xDataList[n].any() > curMax:
curMax = max(xDataList[n])
xMax = curMax
if yMax == 0:
curMax = 0
for n in range(0, len(yDataList)):
if type(yDataList[n]) == list:
if max(yDataList[n]) > curMax:
curMax = max(yDataList[n])
else:
if yDataList[n].any() > curMax:
curMax = max(yDataList[n])
yMax = curMax
plt.axes([0.1, 0.1, 0.71, 0.8])
if traceNameList == []:
for n in range(0, len(xDataList)):
traceNameList.append("Trace_" + str(n))
for n in range(0, len(xDataList)):
xData = convert_list_to_array(xDataList[n])
yData = convert_list_to_array(yDataList[n])
tempPlot = plt.plot(
xData, yData, colorDict[str(n + 1)], hold="True",
label=traceNameList[n])
plt.xlabel(xLabel)
plt.ylabel(yLabel)
plt.xlim(xMin, xMax)
plt.ylim(yMin, yMax)
plt.rc("legend", fontsize=legendFont)
if legendFlag == 1:
if legLoc != (0, 0):
print(legLoc)
plt.legend(loc=legLoc)
else:
plt.legend()
plt.savefig(figFileName, dpi=300)
plt.clf()
示例5: display70
def display70(oneSimulation,pathString, separate=False ,saveOnly=True):
'''
show/save figures
'''
self = oneSimulation
tmp = np.asarray(oneSimulation.cf_icf01_region._geometry.boundary)
tmp01= tmp[(0,1,3), :]
tmp = np.asarray(oneSimulation.cf_icf_region._geometry.boundary)
tmp03= tmp[(1,2,3,4), :]
tmp = np.asarray(oneSimulation.df_fco_region._geometry.boundary)
tmpDF = tmp[(0,1,2,3), :]
pylab.rc('axes', linewidth=2) # make the axes boundary lines bold
# fig, ax = plt.subplots()
fig = plt.figure()
fig.set( size_inches=(8.8, 6) )
ax = fig.add_axes([0.1, 0.1, 0.7, 0.7]) # left, bottom, width, height (range 0 to 1)
# if separate:
# rr.plot( self.df_region, 'red', lw=6, axes=ax, label='DF')
# rr.plot( self.cf_region, 'blue', lw=4, axes=ax, label='CF')
# rr.plot( self.fco_region, 'red', lw=6, axes=ax, label='DF')
# rr.plot( self.icf_region_bigR1, 'blue', lw=4, axes=ax, label='ICF')
# rr.plot( self.icf_region_bigR2, 'blue', lw=4, axes=ax)
# rr.plot(self.df_fco_region, 'blue', lw=6, label='DF+FCo')
# rr.plot(self.cf_icf_region, 'red', lw=4, label='CF+ICF Scheme 3')
# rr.plot(self.cf_icf01_region, 'green', lw=2, label='CF+ICF Scheme 1' )
ax.plot(tmpDF[:,0], tmpDF[:,1], 'blue', lw=6, label='DF+FCo')
ax.plot(tmp03[:,0], tmp03[:,1], 'red', lw=4, label='CF+ICF Scheme 3')
ax.plot(tmp01[:,0], tmp01[:,1], 'green', lw=2, label='CF+ICF Scheme 1' )
# fig.suptitle('$g ={},{},{},{}$'.format(self.g13, self.g14, self.g23, self.g24), fontsize=14, fontweight='bold')
ax.set_title(r'$P_s=P_1=P_2={}, \, P_3={}, \, P_4={}, \, N=1$'.format(self.Ps,
self.P3, self.P4),fontdict=self.font)
ax.set_xlabel('$R_1$', fontdict=self.font)
ax.set_ylabel('$R_2$', fontdict=self.font)
#ax.set_xlim(xmin=0, xmax=3.5)
#ax.set_ylim(ymin=0, ymax=3.5)
ax.legend(loc=0)
nameStr = 'PsP3P4_{}_{}_{}_g13g14g23g24_{}_{}_{}_{}'.format(self.Ps, self.P3, self.P4,
self.g13, self.g14, self.g23, self.g24)
savefig.save(path='{}/plots_CF_ICF03__CF_ICF01__DF_FCo/{}'.format(pathString, nameStr), ext='pdf', close=saveOnly, verbose=True)
示例6: violin_plot
def violin_plot(ax, values_list, measure_name, group_names, fontsize, color='blue', ttest=False):
'''
This is a little wrapper around the statsmodels violinplot code
so that it looks nice :)
'''
# IMPORTS
import matplotlib.pylab as plt
import statsmodels.api as sm
import numpy as np
# Make your violin plot from the values_list
# Don't show the box plot because it looks a mess to be honest
# we're going to overlay a boxplot on top afterwards
plt.sca(ax)
# Adjust the font size
font = { 'size' : fontsize}
plt.rc('font', **font)
max_value = np.max(np.concatenate(values_list))
min_value = np.min(np.concatenate(values_list))
vp = sm.graphics.violinplot(values_list,
ax = ax,
labels = group_names,
show_boxplot=False,
plot_opts = { 'violin_fc':color ,
'cutoff': True,
'cutoff_val': max_value,
'cutoff_type': 'abs'})
# Now plot the boxplot on top
bp = plt.boxplot(values_list, sym='x')
for key in bp.keys():
plt.setp(bp[key], color='black', lw=fontsize/10)
# Adjust the power limits so that you use scientific notation on the y axis
plt.ticklabel_format(style='sci', axis='y')
ax.yaxis.major.formatter.set_powerlimits((-3,3))
plt.tick_params(axis='both', which='major', labelsize=fontsize)
# Add the y label
plt.ylabel(measure_name, fontsize=fontsize)
# And now turn off the major ticks on the y-axis
for t in ax.yaxis.get_major_ticks():
t.tick1On = False
t.tick2On = False
return ax
示例7: chi_squared_stats
def chi_squared_stats(self, plot_chisq=False):
"""
Compute chi^2 statistics for an X^2 distribution.
This is essentially a chi^2 test for normality being
computed on residual from the fit. I'll rewrite it
into a chi^2 goodness of fit test when I'll get around
to it.
Returns
-------
prob_chisq : probability that X^2 obeys the chi^2 distribution
dof : degrees of freedom for chi^2
"""
# ------------------- TODO --------------------- #
# rewrite it to a real chi-square goodness of fit!
# this is essentially a chi^2 test for normality
from scipy.stats import chisqprob
# TODO: for Pearson's chisq test it would be
# dof = self.xarr.size - self.specfit.fitter.npars - 1
# NOTE: likelihood function should asymptotically approach
# chi^2 distribution too! Given that the whole point
# of calculating chi^2 is to use it for model
# selection I should probably switch to it.
# TODO: derive an expression for this "Astronomer's X^2" dof.
dof = self.xarr.size
prob_chisq = chisqprob(self.chi_squared, dof)
# NOTE: for some reason get_modelcube returns zeros for some
# pixels even if corresponding Cube.parcube[:,y,x] is NaN
prob_chisq[np.isnan(self.parcube.min(axis=0))] = np.nan
if plot_chisq:
if not plt.rcParams['text.usetex']:
plt.rc('text', usetex=True)
if self.mapplot.figure is None:
self.mapplot()
self.mapplot.plane = prob_chisq
self.mapplot(estimator=None, cmap='viridis', vmin=0, vmax=1)
labtxt = r'$\chi^2\mathrm{~probability~(%i~d.o.f.)}$' % dof
self.mapplot.FITSFigure.colorbar.set_axis_label_text(labtxt)
plt.show()
self.prob_chisq = prob_chisq
return prob_chisq, dof
示例8: plot
def plot(self):
name = self.get_tag()
Y_list = self.get_geom().get_XYZ()[1,:]
plt.xlim(1.1*Y_list[0], 1.1*Y_list[-1])
plt.xlabel('y')
plt.ylabel('gamma')
plt.plot(Y_list,self.__gamma)
plt.rc("font", size=14)
plt.savefig(name+"_gamma_distrib.png",format='png')
plt.close()
plt.xlim(1.1*Y_list[0], 1.1*Y_list[-1])
plt.xlabel('y')
plt.ylabel('iAoA')
plt.plot(Y_list,self.__iAoA*self.RAD_TO_DEG)
plt.rc("font", size=14)
plt.savefig(name+"_iAoA_distrib.png",format='png')
plt.close()
示例9: AxisFormat
def AxisFormat(FONTSIZE = 22, TickSize = 10, TickDirection = 'out'):
"""
Format axes to standard design.
:param FONTSIZE: desired fontsize of all fonts.
:type FONTSIZE: int
:param TickSize: size of ticks in pxls.
:type TickSize: int
:param TickDirection: decide whether to plot ticks in or out
:type TickDirection: str
:returns: altered axes.
.. note::
* This function should work if called prior to plot input.
**Usage**
.. code-block:: python
:emphasize-lines: 3
fig = plt.figure(figsize=(8,6))
ax = fig.add_subplot(111)
pf.AxisFormat()
ax.plot(np.arange(0,100), np.arange(0,100), 'b-', linewidth =2)
plt.tight_layout()
plt.show()
**Exmaple**
*simple plot without AxisFormat call*
.. plot:: pyplots/AxisFormatDemo1.py
:include-source:
*simple plotnwith AxisFormat call*
.. plot:: pyplots/AxisFormatDemo2.py
:include-source:
"""
font = {'weight': 'norm', 'size': FONTSIZE}
legend = {'frameon': False}
ticks = {'direction': TickDirection, 'major.size': TickSize,
'minor.size': TickSize - 2}
plt.rc('font', **font)
plt.rc('legend', **legend)
plt.rc('xtick', **ticks)
plt.rc('ytick', **ticks)
示例10: __init__
def __init__(self):
"""
"""
fig = plt.figure(facecolor = 'w', figsize = [12, 12])
fig.subplots_adjust(left=0.05, right=0.95, top=0.95, bottom=0.05)
ax1 = fig.add_subplot(1, 1, 1, aspect='equal')
self.t = np.arange(0, len(Nodes['age']))
self.x = xx[self.t]
self.y = yy[self.t]
self.age = Nodes['age'][self.t]
plot_eye(Nodes,ax1)
ax1.set_xlabel('mm',fontsize=20)
ax1.set_ylabel('mm',fontsize=20)
self.line1 = Line2D([], [], color='red', linewidth=4)
self.line1e = Line2D([], [], color='red', marker='o', markeredgecolor='r', markersize=10)
self.text = ax1.text(0.05, 0.05, 'Age: %s'%self.age[0] , fontsize=18, animated = True,
transform=ax1.transAxes)
ax1.add_line(self.line1)
ax1.add_line(self.line1e)
ax1.set_xlim(-14, 14)
ax1.set_ylim(-14, 14)
ax1.set_title('eye growth simulation',fontsize=20)
ax1.set_xticks([-10, -5, 0, 5, 10])
ax1.set_yticks([-10, -5, 0, 5, 10])
plt.rc('xtick', labelsize=20)
plt.rc('ytick', labelsize=20)
plt.tight_layout()
animation.TimedAnimation.__init__(self, fig, interval=10, blit=True)
示例11: display
def display(oneSimulation,pathString ,saveOnly=True):
'''
Produce a graph that compare three ICF schemes
'''
self = oneSimulation
# get the union rate region for plotting
icf_sch1 = rr.union( [self.icf_sch1_bigR1, self.icf_sch1_bigR2] )
icf_sch2 = rr.union( [self.icf_sch2_bigR1, self.icf_sch2_bigR2] )
icf_sch3 = rr.union( [self.icf_sch3_bigR1, self.icf_sch3_bigR2] )
pylab.rc('axes', linewidth=2) # make the axes boundary lines bold
fig, ax = plt.subplots()
rr.plot( icf_sch1, 'g', axes=ax, label='Scheme 1')
rr.plot( icf_sch2, 'b', axes=ax, label='Scheme 2')
rr.plot( icf_sch3, 'r', axes=ax, label='Scheme 3')
# plot the line: R2 = R1
tmp = np.asarray(self.icf_sch1_bigR1._geometry.boundary)
tmp2 = [[0, tmp[1, 0]], [0, tmp[1, 1] ] ]
ax.plot( [0, tmp[1, 0]], [0, tmp[1, 1] ] , 'k--', lw=2)
ax.set_title(r'$ P_3={}, \, P_4={}, \, N=1$'.format(self.P3, self.P4) , fontdict=self.font)
ax.set_xlabel('$R_1$', fontdict=self.font)
ax.set_ylabel('$R_2$', fontdict=self.font)
ax.set_xlim(xmin=0, xmax=3.5)
ax.set_ylim(ymin=0, ymax=3.5)
ax.legend(loc='upper right')
savefig.save(path='{}/compare_three_ICF_Schemes/P3P4_{}_{}'.format(pathString, self.P3, self.P4 ), ext='pdf', close=saveOnly, verbose=True)
if (0):
# add annotations for 3 regions
plt.text(0.7, 2.3, 'capacity region by coherent coding with cardinality-bounding', color='red')
plt.text(1, 1.8, 'non-coherent coding with cardinality-bounding', color='blue')
plt.text(1.3, 1.4, 'capacity region by coherent coding with cardinality-bounding', color='green')
bbox_props = dict(boxstyle="round,pad=0.1", fc="white", ec="g", lw=1)
plt.text(1, 0.5, r'$1$', color='black', bbox=bbox_props)
bbox_props = dict(boxstyle="round,pad=0.1", fc="white", ec="b", lw=1)
plt.text(1.7, 0.4, r'$2$', color='black', bbox=bbox_props)
bbox_props = dict(boxstyle="round,pad=0.1", fc="white", ec="r", lw=1)
plt.text(2.2, 0.3, r'$3$', color='black', bbox=bbox_props)
示例12: plot_matches
def plot_matches(smresbest,lspec):
"""
Plot best matches
Plots the target spectrum along with the top matches
"""
shift = 1
fig,axL = plt.subplots(nrows=2,figsize=(20,12),sharex=True)
plt.sca(axL[0])
targpar = smresbest.rename(columns={'targobs':'obs'})
targpar = dict(targpar['obs ord wlo whi'.split()].iloc[0])
targpar['type'] = 'cps'
targspec = smio.getspec_h5(**targpar)
w = targspec['w']
plt.plot(w,targspec['s'],'k')
plt.rc('axes',color_cycle=['Tomato', 'RoyalBlue'])
for i in smresbest.index:
# Plot target spectrum
plt.sca(axL[0])
y = shift*0.3
plt.plot(w,lspec['lspec'][i]+y)
par = dict(smresbest.ix[i])
par['y'] = y+1
annotate_matches(par)
# Plot residuals
plt.sca(axL[1])
y = shift*0.2
plt.plot(w,lspec['fres'][i]+y)
par['y'] = y
annotate_matches(par)
shift+=1
fig.subplots_adjust(left=.03,bottom=.03,top=0.97,right=.8)
示例13: OrientationPlot
def OrientationPlot(OrientationHist_Data,BINS):
"""
Plot an orienation histogram. For use with OrientationHist function
Input
-----
OrientationHist_Data: computed from OrienationHist function
BINS: bins used to compute OrientationHist
Output
------
Produces a polar plot with the orientation histogram data
"""
RAD_BINS = BINS/(180./np.pi)
## Data Plot
plt.rc('grid', color='gray', linewidth=1, linestyle='-')
plt.rc('xtick', labelsize=25)
plt.rc('ytick', labelsize=20)
width, height = plt.rcParams['figure.figsize']
size = min(width, height)
fig = plt.figure(figsize=(size, size))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='w')
plt.polar(RAD_BINS,OrientationHist_Data/float(sum(OrientationHist_Data)), 'k',linewidth=4, marker='o')
ax.set_rmax(0.2)
plt.show()
示例14: create_bar_plots
def create_bar_plots(bins, freq_list, height, group_names, colors, xlabel, ylabel, legend=True):
import matplotlib.pylab as plt
import numpy as np
from matplotlib.ticker import MaxNLocator
fig = plt.figure(figsize=(height*1.5, height))
ax = fig.add_subplot(111)
font = { 'size' : 22 * height/8}
plt.rc('font', **font)
range = np.max(bins) - np.min(bins)
w = range/((len(bins)-1) * len(group_names))
for i, group in enumerate(group_names):
bar = plt.bar(bins + w*i, freq_list[i],
width=w, label = group,
color=colors[i],
edgecolor='none')
# Adjust the power limits so that you use scientific notation on the y axis
plt.ticklabel_format(style='sci', axis='y')
ax.yaxis.major.formatter.set_powerlimits((-3,3))
for t in ax.yaxis.get_major_ticks():
t.tick1On = False
t.tick2On = False
if legend:
plt.legend(loc=0)
plt.ylabel(ylabel)
plt.xlabel(xlabel)
# Make sure the layout looks good :)
fig.tight_layout()
return fig
示例15: plot_histogram
def plot_histogram(df1, df2):
"""
plot histo for question 1 (Difference in REM sleep?)
result => not concluant
df1: normal sleep (df1 = analyse(base))
df2: sleep depravation (df2 = analyse(depr))
"""
plt.rc('font', family='Arial')
N = 5
normal = df1['%5'].tolist()
mean = sum(normal) / len(normal)
normal.extend([mean])
ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(ind, normal, width, color='b')
depravation = df2['%5'].tolist()
mean = sum(depravation) / len(depravation)
depravation.extend([mean])
rects2 = ax.bar(ind+width, depravation, width, color='r')
ax.set_ylabel('Sleep in REM stage (%)')
ax.set_xlabel('Subjects')
ax.set_title('REM sleep comparison', fontsize=20)
ax.set_xticks(ind+width)
ax.set_xticklabels( ('1', '2', '3', '4', 'Mean') )
for label in (ax.get_xticklabels() + ax.get_yticklabels()):
label.set_fontname('Arial')
label.set_fontsize(8)
ax.legend( (rects1[0], rects2[0]), ('Baseline', 'After sleep depravation') , loc = 'lower right', fontsize=10 )