Include analytic vector in plot
This commit is contained in:
parent
4f2a49a0ff
commit
2fde592256
15
src/plot.py
15
src/plot.py
@ -31,12 +31,15 @@ def plot_eigenvectors(N: int, save: bool=False) -> None:
|
|||||||
eigvec = pd.read_csv(path, header=0)
|
eigvec = pd.read_csv(path, header=0)
|
||||||
|
|
||||||
fig, ax = plt.subplots()
|
fig, ax = plt.subplots()
|
||||||
ax.plot(eigvec['x'], eigvec['Vector 1'], label='Vector 1')
|
ax.plot(eigvec['x'], eigvec['Vector 1'], label=r'$\vec{v}_{1}$')
|
||||||
ax.plot(eigvec['x'], eigvec['Vector 2'], label='Vector 2')
|
ax.plot(eigvec['x'], eigvec['Vector 2'], label=r'$\vec{v}_{2}$')
|
||||||
ax.plot(eigvec['x'], eigvec['Vector 3'], label='Vector 3')
|
ax.plot(eigvec['x'], eigvec['Vector 3'], label=r'$\vec{v}_{3}$')
|
||||||
|
ax.plot(eigvec['x'], eigvec['Analytic 1'], '--', label=r'$\vec{v}^{(1)}$')
|
||||||
|
ax.plot(eigvec['x'], eigvec['Analytic 2'], '--', label=r'$\vec{v}^{(2)}$')
|
||||||
|
ax.plot(eigvec['x'], eigvec['Analytic 3'], '--', label=r'$\vec{v}^{(3)}$')
|
||||||
ax.set_xlabel(r'Element $\hat{x}_{i}$')
|
ax.set_xlabel(r'Element $\hat{x}_{i}$')
|
||||||
ax.set_ylabel(r'Value of element $v_{i}$')
|
ax.set_ylabel(r'Element $v_{i}$')
|
||||||
ax.legend()
|
ax.legend(loc='upper left')
|
||||||
|
|
||||||
# Save to file
|
# Save to file
|
||||||
if save is True:
|
if save is True:
|
||||||
@ -46,7 +49,7 @@ def plot_eigenvectors(N: int, save: bool=False) -> None:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
plot_transformations(True)
|
# plot_transformations(True)
|
||||||
plot_eigenvectors(6, True)
|
plot_eigenvectors(6, True)
|
||||||
plot_eigenvectors(100, True)
|
plot_eigenvectors(100, True)
|
||||||
# plt.show()
|
# plt.show()
|
||||||
Loading…
Reference in New Issue
Block a user