我尝试在2x2或1x4网格中绘制四组绘图。每一组又有三个面板,比如说,在侧面有x轴和y轴直方图的散点图。在
我不想为所有12个绘图设置轴,而是将我的画布分成4个部分,然后分别分割每个部分。例如
def plot_subset():
# these coords are normalized to this subset of plots
pos_axScatter=[0.10, 0.10, 0.65, 0.65]
pos_axHistx = [0.10, 0.75, 0.65, 0.20]
pos_axHisty = [0.75, 0.10, 0.20, 0.20]
axScatter = plt.axes(pos_axScatter)
axHistx = plt.axes(pos_axHistx)
axHisty = plt.axes(pos_axHisty)
def main():
# need to divide the canvas to a 2x2 grid
plot_subset(1)
plot_subset(2)
plot_subset(3)
plot_subset(4)
plt.show()
我尝试过GridSpec和subblot,但找不到一种使plot_subset()在规范化空间中工作的方法。任何帮助都将不胜感激!在
您可以使用
BboxTransformTo()
来执行此操作:输出:
相关问题 更多 >
编程相关推荐