Skip to content

Instantly share code, notes, and snippets.

@dragly
Created March 6, 2015 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dragly/48e4690f30e1d7147cd3 to your computer and use it in GitHub Desktop.
Save dragly/48e4690f30e1d7147cd3 to your computer and use it in GitHub Desktop.
from pylab import *
from mpl_toolkits.axes_grid.inset_locator import zoomed_inset_axes, inset_axes, mark_inset
r12s = linspace(0, 6, 1000)
energies = 0.01*sin(10*r12s) - 1.0
r12s = array(r12s)
energies = array(energies)
ax = axes()
plot(r12s, energies, "-", label="UHF")
xlabel(r"$R$")
ylabel(r"$E$")
xlim(0,6)
ylim(-1.2,-0.5)
legend()
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.get_xaxis().tick_bottom()
ax.get_yaxis().tick_left()
axin = inset_axes(ax, width="30%", height="30%", loc=5)
axin.plot(r12s,energies)
axin.set_xlim(5.0, 5.98)
axin.set_ylim(-1.005, -0.985)
axin.set_xticks([])
axin.set_yticks([-1.01, -1.0, -0.99])
mark_inset(ax, axin, loc1=3, loc2=4, fc="none", ec="0.5")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment