Skip to content
Snippets Groups Projects
Commit 27b249ec authored by Anton Akhmerov's avatar Anton Akhmerov Committed by Christoph Groth
Browse files

make axes labeled use A [B] instead of A [in units of B]

parent 689d0ba5
No related branches found
No related tags found
No related merge requests found
Showing
with 58 additions and 60 deletions
......@@ -79,5 +79,3 @@ Roughly in order of importance. -*-org-*-
* Adopt mincut/maxflow algorithm from networkx or python-graph to find the best
representation of a lead unit cell.
* Tutorial choose either "A [B]" or "A in units of B" consistently.
......@@ -86,12 +86,12 @@
- pyplot.figure()
+ fig = pyplot.figure()
pyplot.plot(normalized_fluxes, data)
- pyplot.xlabel("flux [in units of the flux quantum]")
- pyplot.ylabel("conductance [in units of e^2/h]")
- pyplot.xlabel("flux [flux quantum]")
- pyplot.ylabel("conductance [e^2/h]")
- pyplot.show()
+ pyplot.xlabel("flux [in units of the flux quantum]",
+ pyplot.xlabel("flux [flux quantum]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("conductance [in units of e^2/h]",
+ pyplot.ylabel("conductance [e^2/h]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.setp(fig.get_axes()[0].get_xticklabels(),
+ fontsize=_defs.mpl_tick_size)
......
......@@ -13,13 +13,13 @@
def main():
lead = make_lead().finalized()
- kwant.plotter.bands(lead, show=False)
- pyplot.xlabel("momentum in units of inverse lattice constant")
- pyplot.ylabel("energy in units of t")
- pyplot.xlabel("momentum [(lattice constant)^-1]")
- pyplot.ylabel("energy [t]")
- pyplot.show()
+ fig = kwant.plotter.bands(lead, show=False)
+ pyplot.xlabel("momentum in units of inverse lattice constant",
+ pyplot.xlabel("momentum [(lattice constant)^-1]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("energy in units of t", fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("energy [t]", fontsize=_defs.mpl_label_size)
+ pyplot.setp(fig.get_axes()[0].get_xticklabels(),
+ fontsize=_defs.mpl_tick_size)
+ pyplot.setp(fig.get_axes()[0].get_yticklabels(),
......
......@@ -15,12 +15,12 @@
- pyplot.figure()
+ fig = pyplot.figure()
pyplot.plot(Bfields, energies)
- pyplot.xlabel("magnetic field [some arbitrary units]")
- pyplot.ylabel("energy [in units of t]")
- pyplot.xlabel("magnetic field [arbitrary units]")
- pyplot.ylabel("energy [t]")
- pyplot.show()
+ pyplot.xlabel("magnetic field [some arbitrary units]",
+ pyplot.xlabel("magnetic field [arbitrary units]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("energy [in units of t]", fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("energy [t]", fontsize=_defs.mpl_label_size)
+ pyplot.setp(fig.get_axes()[0].get_xticklabels(),
+ fontsize=_defs.mpl_tick_size)
+ pyplot.setp(fig.get_axes()[0].get_yticklabels(),
......
......@@ -15,12 +15,12 @@
- pyplot.figure()
+ fig = pyplot.figure()
pyplot.plot(energies, data)
- pyplot.xlabel("energy [in units of t]")
- pyplot.ylabel("conductance [in units of e^2/h]")
- pyplot.xlabel("energy [t]")
- pyplot.ylabel("conductance [e^2/h]")
- pyplot.show()
+ pyplot.xlabel("energy [in units of t]",
+ pyplot.xlabel("energy [t]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("conductance [in units of e^2/h]",
+ pyplot.ylabel("conductance [e^2/h]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.setp(fig.get_axes()[0].get_xticklabels(),
+ fontsize=_defs.mpl_tick_size)
......@@ -39,12 +39,12 @@
- pyplot.figure()
+ fig = pyplot.figure()
pyplot.plot(momenta, energies)
- pyplot.xlabel("momentum [in units of (lattice constant)^-1]")
- pyplot.ylabel("energy [in units of t]")
- pyplot.xlabel("momentum [(lattice constant)^-1]")
- pyplot.ylabel("energy [t]")
- pyplot.show()
+ pyplot.xlabel("momentum [in units of (lattice constant)^-1]",
+ pyplot.xlabel("momentum [(lattice constant)^-1]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("energy [in units of t]",
+ pyplot.ylabel("energy [t]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.setp(fig.get_axes()[0].get_xticklabels(),
+ fontsize=_defs.mpl_tick_size)
......
......@@ -15,12 +15,12 @@
- pyplot.figure()
+ fig = pyplot.figure()
pyplot.plot(welldepths, data)
- pyplot.xlabel("well depth [in units of t]")
- pyplot.ylabel("conductance [in units of e^2/h]")
- pyplot.xlabel("well depth [t]")
- pyplot.ylabel("conductance [e^2/h]")
- pyplot.show()
+ pyplot.xlabel("well depth [in units of t]",
+ pyplot.xlabel("well depth [t]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("conductance [in units of e^2/h]",
+ pyplot.ylabel("conductance [e^2/h]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.setp(fig.get_axes()[0].get_xticklabels(),
+ fontsize=_defs.mpl_tick_size)
......
......@@ -27,11 +27,11 @@
-pyplot.figure()
+fig = pyplot.figure()
pyplot.plot(energies, data)
-pyplot.xlabel("energy [in units of t]")
-pyplot.ylabel("conductance [in units of e^2/h]")
-pyplot.xlabel("energy [t]")
-pyplot.ylabel("conductance [e^2/h]")
-pyplot.show()
+pyplot.xlabel("energy [in units of t]", fontsize=_defs.mpl_label_size)
+pyplot.ylabel("conductance [in units of e^2/h]", fontsize=_defs.mpl_label_size)
+pyplot.xlabel("energy [t]", fontsize=_defs.mpl_label_size)
+pyplot.ylabel("conductance [e^2/h]", fontsize=_defs.mpl_label_size)
+pyplot.setp(fig.get_axes()[0].get_xticklabels(), fontsize=_defs.mpl_tick_size)
+pyplot.setp(fig.get_axes()[0].get_yticklabels(), fontsize=_defs.mpl_tick_size)
+fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.)
......
......@@ -15,11 +15,11 @@
- pyplot.figure()
+ fig = pyplot.figure()
pyplot.plot(energies, data)
- pyplot.xlabel("energy [in units of t]")
- pyplot.ylabel("conductance [in units of e^2/h]")
- pyplot.xlabel("energy [t]")
- pyplot.ylabel("conductance [e^2/h]")
- pyplot.show()
+ pyplot.xlabel("energy [in units of t]", fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("conductance [in units of e^2/h]",
+ pyplot.xlabel("energy [t]", fontsize=_defs.mpl_label_size)
+ pyplot.ylabel("conductance [e^2/h]",
+ fontsize=_defs.mpl_label_size)
+ pyplot.setp(fig.get_axes()[0].get_xticklabels(),
+ fontsize=_defs.mpl_tick_size)
......
......@@ -15,8 +15,8 @@
- kwant.plotter.bands(lead, momenta=np.linspace(-1.5, 1.5, 101), show=False)
+ fig = kwant.plotter.bands(lead, momenta=np.linspace(-1.5, 1.5, 101),
+ show=False)
pyplot.xlabel("momentum [in untis of (lattice constant)^-1]")
pyplot.ylabel("energy [in units of t]")
pyplot.xlabel("momentum [(lattice constant)^-1]")
pyplot.ylabel("energy [t]")
pyplot.ylim([-0.8, 0.8])
- pyplot.show()
+ pyplot.setp(fig.get_axes()[0].get_xticklabels(),
......
......@@ -15,8 +15,8 @@
- pyplot.figure()
+ fig = pyplot.figure()
pyplot.plot(energies, data)
pyplot.xlabel("energy [in units of t]")
pyplot.ylabel("conductance [in units of e^2/h]")
pyplot.xlabel("energy [t]")
pyplot.ylabel("conductance [e^2/h]")
- pyplot.show()
+ pyplot.setp(fig.get_axes()[0].get_xticklabels(),
+ fontsize=_defs.mpl_tick_size)
......
......@@ -103,8 +103,8 @@ def plot_conductance(sys, energy, fluxes):
pyplot.figure()
pyplot.plot(normalized_fluxes, data)
pyplot.xlabel("flux [in units of the flux quantum]")
pyplot.ylabel("conductance [in units of e^2/h]")
pyplot.xlabel("flux [flux quantum]")
pyplot.ylabel("conductance [e^2/h]")
pyplot.show()
......
......@@ -37,8 +37,8 @@ def make_lead(a=1, t=1.0, W=10):
def main():
lead = make_lead().finalized()
kwant.plotter.bands(lead, show=False)
pyplot.xlabel("momentum in units of inverse lattice constant")
pyplot.ylabel("energy in units of t")
pyplot.xlabel("momentum [(lattice constant)^-1]")
pyplot.ylabel("energy [t]")
pyplot.show()
#HIDDEN_END_pejz
......
......@@ -72,8 +72,8 @@ def plot_spectrum(sys, Bfields):
pyplot.figure()
pyplot.plot(Bfields, energies)
pyplot.xlabel("magnetic field [some arbitrary units]")
pyplot.ylabel("energy [in units of t]")
pyplot.xlabel("magnetic field [arbitrary units]")
pyplot.ylabel("energy [t]")
pyplot.show()
#HIDDEN_END_yvri
......
......@@ -120,8 +120,8 @@ def plot_conductance(sys, energies):
pyplot.figure()
pyplot.plot(energies, data)
pyplot.xlabel("energy [in units of t]")
pyplot.ylabel("conductance [in units of e^2/h]")
pyplot.xlabel("energy [t]")
pyplot.ylabel("conductance [e^2/h]")
pyplot.show()
......@@ -131,8 +131,8 @@ def plot_bandstructure(flead, momenta):
pyplot.figure()
pyplot.plot(momenta, energies)
pyplot.xlabel("momentum [in units of (lattice constant)^-1]")
pyplot.ylabel("energy [in units of t]")
pyplot.xlabel("momentum [(lattice constant)^-1]")
pyplot.ylabel("energy [t]")
pyplot.show()
......
......@@ -68,8 +68,8 @@ def plot_conductance(sys, energy, welldepths):
pyplot.figure()
pyplot.plot(welldepths, data)
pyplot.xlabel("well depth [in units of t]")
pyplot.ylabel("conductance [in units of e^2/h]")
pyplot.xlabel("well depth [t]")
pyplot.ylabel("conductance [e^2/h]")
pyplot.show()
#HIDDEN_END_sqvr
......
......@@ -122,7 +122,7 @@ for ie in xrange(100):
pyplot.figure()
pyplot.plot(energies, data)
pyplot.xlabel("energy [in units of t]")
pyplot.ylabel("conductance [in units of e^2/h]")
pyplot.xlabel("energy [t]")
pyplot.ylabel("conductance [e^2/h]")
pyplot.show()
#HIDDEN_END_lliv
......@@ -68,8 +68,8 @@ def plot_conductance(sys, energies):
pyplot.figure()
pyplot.plot(energies, data)
pyplot.xlabel("energy [in units of t]")
pyplot.ylabel("conductance [in units of e^2/h]")
pyplot.xlabel("energy [t]")
pyplot.ylabel("conductance [e^2/h]")
pyplot.show()
#HIDDEN_END_ayuk
......
......@@ -83,8 +83,8 @@ def plot_conductance(sys, energies):
pyplot.figure()
pyplot.plot(energies, data)
pyplot.xlabel("energy [in units of t]")
pyplot.ylabel("conductance [in units of e^2/h]")
pyplot.xlabel("energy [t]")
pyplot.ylabel("conductance [e^2/h]")
pyplot.show()
......
......@@ -49,8 +49,8 @@ def main():
lead = make_lead().finalized()
kwant.plotter.bands(lead, momenta=np.linspace(-1.5, 1.5, 101), show=False)
pyplot.xlabel("momentum [in untis of (lattice constant)^-1]")
pyplot.ylabel("energy [in units of t]")
pyplot.xlabel("momentum [(lattice constant)^-1]")
pyplot.ylabel("energy [t]")
pyplot.ylim([-0.8, 0.8])
pyplot.show()
......
......@@ -108,8 +108,8 @@ def plot_conductance(sys, energies):
pyplot.figure()
pyplot.plot(energies, data)
pyplot.xlabel("energy [in units of t]")
pyplot.ylabel("conductance [in units of e^2/h]")
pyplot.xlabel("energy [t]")
pyplot.ylabel("conductance [e^2/h]")
pyplot.show()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment