Commit dadd7489 authored by Joseph Weston's avatar Joseph Weston

use plotter.density instead of plotter.map in tutorial

Closes #214.
parent 99183543
Pipeline #18388 passed with stages
in 41 minutes and 55 seconds
......@@ -63,7 +63,7 @@
ham = syst.hamiltonian_submatrix(params=dict(V=potential), sparse=True)
evecs = scipy.sparse.linalg.eigsh(ham, k=10, which='SM')[1]
kwant.plotter.map(syst, abs(evecs[:, n])**2, show=False)
kwant.plotter.density(syst, abs(evecs[:, n])**2, show=False)
#HIDDEN_END_plot_eigenstate
- plt.show()
+ save_figure('discretizer_gs')
......@@ -136,8 +136,8 @@
rho_sz = sum(spin_density(psi) for psi in wf(0)) # states from left lead
fig, (ax1, ax2) = plt.subplots(1, 2, sharey=True, figsize=(16, 4))
kwant.plotter.map(syst, wf_sqr, ax=ax1)
kwant.plotter.map(syst, rho_sz, ax=ax2)
kwant.plotter.density(syst, wf_sqr, ax=ax1)
kwant.plotter.density(syst, rho_sz, ax=ax2)
#HIDDEN_END_plot_qsh_wf
ax = ax1
im = [obj for obj in ax.get_children()
......
......@@ -119,7 +119,7 @@
+def plot_densities(syst, densities, fname=None):
+ fig, axes = plt.subplots(1, len(densities), figsize=(7*len(densities), 7))
for ax, (title, rho) in zip(axes, densities):
kwant.plotter.map(syst, rho, ax=ax, a=4)
kwant.plotter.density(syst, rho, ax=ax)
ax.set_title(title)
- plt.show()
+ if fname:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment