rebalance(axis, ids, *args)
rebalance('x', ids), where ids is a list of named panels, rebalances horizontal space between the panels. This works if ids represent a single horizontal row of panels or a grid of panels. After, the horizontal scale of all of the panels will be the same, and axes will be aligned within columns (as per alignaxes).
rebalance('x', ids, moreids, ...) rebalances across all the columns represented by the panels named in ids and moreids, but does not assume that the horizontal scales are the same between the two groups of panels. There is no limit on the number of groups of panels that can be rebalanced concurrently.
rebalance('y', ...) rebalances vertical space.
rebalance('xy', ...) rebalances in both directions.
See also commonscale and alignaxes.
import qplot as qp
import numpy as np
qp.figure('rebalance', 3, 3)
idA = qp.subplot(2,1,0)
xx = np.arange(75)
qp.plot(xx, np.sqrt(xx))
qp.xaxis(ticks=[0,25,50,75])
qp.yaxis(ticks=[0,2,4,6,8,10])
qp.shrink()
idB = qp.subplot(2,1,1)
xx = np.arange(25,125)
qp.plot(xx, 20+2*np.cos(xx/10))
qp.axshift(5)
qp.xaxis(ticks=[25,50,75,100,125], y=18)
qp.yaxis('Sinusoid', ticks=[18,20,22],x=25)
qp.shrink()
qp.rebalance('xy', [idA, idB])