lgf = {'family':'sans-serif','style':'normal','weight':'medium','size':18} pp.rc('font', **smf) pp.rc('lines',lw=2) # plotting fig,ax_array = pp.subplots(nrows=2,ncols=1,figsize=res,dpi=dpi,sharex=True) figtool.axes_weight_global(ax_array,weight=1,ticksize=5) fig.patch.set_alpha(1.0) # set to 0.0 for transparency for ax in ax_array: ax.patch.set_facecolor('white') epoc_time = cpu_array[:,0] - cpu_array[0,0] mem_usage = 100*mem_array[:,2] for cpu_usage in 100*cpu_array[:,1:].T: ax_array[0].plot(epoc_time,cpu_usage) ax_array[1].plot(epoc_time,mem_usage) # ax.text(1.0/20,2.0/30,'gaussian noise',color='blue',transform=ax.transAxes) pp.ylim(0,100) pp.xlabel('epoc_time',**smf) pp.ylabel('percentage (%)',**smf) pp.title('cpu and memory tracking',**lgf) io.savefig('sys_tracking.png',dpi=dpi,format='png',timestamp=False) pp.show()
x = np.linspace(0,10,N) y = np.random.normal(0,1,N) # quality and appearance settings res = (15,10) dpi = 72 smf = {'family':'sans-serif','style':'normal','weight':'medium','size':18} lgf = {'family':'sans-serif','style':'normal','weight':'medium','size':18} pp.rc('font', **smf) pp.rc('lines',lw=2) # plotting fig, ax = pp.subplots(nrows=1,ncols=1,figsize=res,dpi=dpi) figtool.axes_weight_global(ax,weight=2,ticksize=5) fig.patch.set_alpha(0.0) ax.patch.set_facecolor('white') pp.plot(x,y) ax.text(1.0/20,2.0/30,'gaussian noise',color='blue',transform=ax.transAxes) pp.xlim(0,10) pp.ylim(-5,5) pp.xlabel('linspace(0,10,1000)',**smf) pp.ylabel('N(0,1)',**smf) pp.title('Normal model N(0,1) sampled N = ' + str(N),**lgf) io.savefig('normal.png',dpi=dpi,format='png',timestamp=False) pp.show()