Marchettibenjamin.files.wordpress.com



%matplotlib inline

from pylab import *

import numpy

from __future__ import division

import matplotlib.pyplot as plt

import matplotlib

from itertools import chain

SMALL_SIZE = 13

MEDIUM_SIZE = 22

BIGGER_SIZE = 40

plt.rc('font', size=BIGGER_SIZE) # controls default text sizes

plt.rc('axes', titlesize=BIGGER_SIZE) # fontsize of the axes title

plt.rc('axes', labelsize=BIGGER_SIZE) # fontsize of the x and y labels

plt.rc('xtick', labelsize=BIGGER_SIZE) # fontsize of the tick labels

plt.rc('ytick', labelsize=BIGGER_SIZE) # fontsize of the tick labels

plt.rc('legend', fontsize=MEDIUM_SIZE) # legend fontsize

#plt.rc('figure', titlesize=BIGGER_SIZE) # fontsize of the figure title

#Latex

plt.rc('text', usetex=True)

plt.rc('font', family='serif')

symbolsize=200

I=linspace(0.1,1.3,13)

B=[0.0114,0.02,0.0291,0.0398,0.0491,0.0597,0.0696,0.078,0.0883,0.0973,0.1073,0.1165,0.125] #(T)

Vh=[2.8,4,5.3,6.6,7.9,9.4,10.7,12,13.4,14.6,16,17.1,18.4]#mV

Vh=array(Vh)*0.001

alpha = np.polyfit(I, B, 1)

alpha_b = np.polyfit(B, Vh, 1)

print alpha

print alpha_b

fig1,axes =plt.subplots(1,2,figsize=(20,10))

axes[0].scatter(I,B,s=symbolsize,alpha=0.7,zorder=1)

axes[0].plot([0,10],[0*alpha[0]+alpha[1],10*alpha[0]+alpha[1]],'r-',linewidth=3,zorder=0)

axes[0].text(0.7,0.06,r'$y=0.096x+0.001$',fontsize=32)

axes[0].set_xlim(0,1.5)

axes[0].set_ylim(0,0.15)

axes[0].set_xlabel(r'$I_B(A)$')

axes[0].set_ylabel(r'$B(T)$')

axes[1].scatter(B,Vh,s=symbolsize,alpha=0.7,zorder=1)

axes[1].plot([0,10],[0*alpha_b[0]+alpha_b[1],10*alpha_b[0]+alpha_b[1]],'r-',linewidth=3,zorder=0)

axes[1].text(0.06,0.0075,r'$y=0.137x+0.001$',fontsize=32)

axes[1].set_ylim(0,0.02)

axes[1].set_xlim(0,0.15)

axes[1].set_ylabel(r'$V_H(V)$')

axes[1].set_xlabel(r'$B(T)$')

axes[1].set_yticks(np.arange(0, 0.021, 0.005));

axes[1].set_xticks(np.arange(0,0.151,0.03));

fig1.tight_layout()

savefig('1_plot.pdf',dpi=300)

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download