hi, i'd like to use the divider stuff in axes_grid to plot a figure
with 2 axes, with xticks on the bottom axis.
in the script pasted below, if i use 0.07 as the min for the y-axis,
then it chops off the top of the plot. if i use 0 as the min, then
it doesn't chop of the top, but it doesnt show the x-axis
ticks/labels. how can i have the divider account for the room needed
labels and ticks?
i've also tried:
hori = [Size.AxesX(axes)]
vert = [Size.Scaled(0.3), Size.Scaled(0.7)]
d = Divider(f, rect, hori, vert)
with same problem.
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid import make_axes_locatable
import numpy as np
f = plt.figure()
rect = (0, 0.07, 1, 1)
#rect = (0, 0, 1, 1)
ax = f.add_axes(rect, autoscale_on=False, aspect="auto")
divider = make_axes_locatable(ax)
ax2 = divider.new_vertical(size="30%", pad=0.0)
axes = [ax, ax2]
for ax in axes:
ax.plot(np.sin(np.linspace(0, 10, 1600)))