Skip to content

Commit

Permalink
Adding centering feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ifilot committed May 2, 2023
1 parent 495eb2b commit 93aa9cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/al_fcc111_zavg.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

data = np.loadtxt('z_extraction.txt')
plt.figure(dpi=72)

# to center the x-axis such that the origin lies at in the middle
# of the graph, uncomment the line below
#data[:,0] = data[:,0] - (np.max(data[:,0]) - np.min(data[:,0])) / 2

plt.plot(data[:,0], data[:,1], color='black')
plt.xlabel(r'z [$\AA$]')
plt.ylabel(r'$\rho$ [$\AA^{-3}$]')
Expand Down

0 comments on commit 93aa9cc

Please sign in to comment.