--- original +++ modified @@ -17,6 +17,7 @@ # For plotting from matplotlib import pyplot +import _defs # Define the graphene lattice @@ -100,22 +101,40 @@ smatrix = kwant.solve(sys, energy) data.append(smatrix.transmission(0, 1)) - pyplot.figure() + fig = pyplot.figure() pyplot.plot(energies, data) - pyplot.xlabel("energy [t]") - pyplot.ylabel("conductance [e^2/h]") - pyplot.show() + 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.) + fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15) + fig.savefig("graphene_result.pdf") + fig.savefig("graphene_result.png", dpi=_defs.dpi) def plot_bandstructure(flead, momenta): bands = kwant.physics.Bands(flead) energies = [bands(k) for k in momenta] - pyplot.figure() + fig = pyplot.figure() pyplot.plot(momenta, energies) - pyplot.xlabel("momentum [(lattice constant)^-1]") - pyplot.ylabel("energy [t]") - pyplot.show() + pyplot.xlabel("momentum [(lattice constant)^-1]", + 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(), + fontsize=_defs.mpl_tick_size) + fig.set_size_inches(_defs.mpl_width_in, _defs.mpl_width_in * 3. / 4.) + fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15) + fig.savefig("graphene_bs.pdf") + fig.savefig("graphene_bs.png", dpi=_defs.dpi) def main(): @@ -127,8 +146,11 @@ def family_colors(site): return 0 if site.family == a else 1 - # Plot the closed system without leads. - kwant.plot(sys, site_color=family_colors, site_lw=0.12, colorbar=False) + size = (_defs.figwidth_in, _defs.figwidth_in) + kwant.plot(sys, site_color=family_colors, site_lw=0.12, colorbar=False, + file="graphene_sys1.pdf", fig_size=size, dpi=_defs.dpi) + kwant.plot(sys, site_color=family_colors, site_lw=0.12, colorbar=False, + file="graphene_sys1.png", fig_size=size, dpi=_defs.dpi) # Compute some eigenvalues. compute_evs(sys.finalized()) @@ -137,9 +159,13 @@ for lead in leads: sys.attach_lead(lead) - # Then, plot the system with leads. - kwant.plot(sys, site_color=family_colors, site_lw=0.12, - lead_site_lw=0, colorbar=False) + size = (_defs.figwidth_in, 0.9 * _defs.figwidth_in) + kwant.plot(sys, site_color=family_colors, colorbar=False, site_lw=0.12, + file="graphene_sys2.pdf", fig_size=size, dpi=_defs.dpi, + lead_site_lw=0) + kwant.plot(sys, site_color=family_colors, colorbar=False, site_lw=0.12, + file="graphene_sys2.png", fig_size=size, dpi=_defs.dpi, + lead_site_lw=0) # Finalize the system. sys = sys.finalized()