In [1]:
import numpy as np
import matplotlib.pyplot as plt
import glob

%matplotlib inline

In [2]:
# Load filenames
filenames = sorted(glob.glob('data/quantum_hall/*'))

fig, axs = plt.subplots(1, 2, figsize=(12, 6))
         
for filename in filenames:
    data = np.genfromtxt(filename, dtype="f8, f8 ,f8", names=['b','vxx','vxy'], skip_header=7, delimiter=';')
        
    gate_voltage = filename.split('_')[-1][:-4]
        
    axs[0].plot(data['b'], data['vxx'] * 1e9, '-', label=gate_voltage)
    axs[1].plot(data['b'], data['vxy'] * 1e9, '-', label=gate_voltage)
    
for n in range(2, 7):
    axs[0].axhline(25812 / n, color='black', ls='--', lw=0.5)

axs[0].set_ylim(0, 25000)
axs[0].set_title('Hall resistance')
axs[0].set_xlabel('magnetic field B (T)')
axs[0].set_ylabel('Rxx (Ohm)')
axs[0].legend(loc=2)

axs[1].set_ylim(0, 7000)
axs[1].set_title('Longitudinal resistance') 
axs[1].set_xlabel('magnetic field B (T)')
axs[1].set_ylabel('Rxy (Ohm)')
axs[1].legend(loc=2);

plt.tight_layout()