I am plotting a double-slit diffraction experiment graph using Matplotlib in Python. What I want is to shift the graph so that the central maximum is at 0. (Right now the maximum of voltage occurs at x=2.7 mm). How can I do that?
Double slit diffraction experiment plot
plt.style.use('ggplot')
x = df['Position']
y = df['Voltage']
plt.figure(figsize=(8,6))
plt.plot(x,y, marker='.', markersize=14, linewidth=3.5, color='#5f5f5f')
plt.ylim(0,4)
plt.xlabel('Position[mm]', fontsize=15)
plt.ylabel('Voltage[V]', fontsize=15)
plt.xticks(fontsize=13)
plt.yticks(fontsize=13)
plt.title('Position v.s. Voltage Plot for Two Slit Diffraction', fontsize=18)
plt.savefig('2slit')
plt.show()
