def plot_profile_inset(model_info, ax): p = ax.get_position() width, height = 0.4 * (p.x1 - p.x0), 0.4 * (p.y1 - p.y0) left, bottom = p.x1 - width, p.y1 - height inset = plt.gcf().add_axes([left, bottom, width, height]) x, y, labels = call_profile(model_info) inset.plot(x, y, '-') inset.locator_params(nbins=4) #inset.set_xlabel(labels[0]) #inset.set_ylabel(labels[1]) inset.text(0.99, 0.99, "profile", horizontalalignment="right", verticalalignment="top", transform=inset.transAxes)
def plot_profile_inset(model_info, ax): # type: (ModelInfo, Axes) -> None """ Plot 1D radial profile as inset plot. """ import matplotlib.pyplot as plt p = ax.get_position() width, height = 0.4 * (p.x1 - p.x0), 0.4 * (p.y1 - p.y0) left, bottom = p.x1 - width, p.y1 - height inset = plt.gcf().add_axes([left, bottom, width, height]) x, y, labels = call_profile(model_info) inset.plot(x, y, '-') inset.locator_params(nbins=4) #inset.set_xlabel(labels[0]) #inset.set_ylabel(labels[1]) inset.text(0.99, 0.99, "profile", horizontalalignment="right", verticalalignment="top", transform=inset.transAxes)