简体   繁体   English

如何在子图中创建子图?

[英]How can I make a subplot in a subplot?

I'm looking to make a 2 by 1 subplot, where the second subplot is a 1 by 2 subplot. 我正在寻找一个2 x 1子图,其中第二个子图是1 x 2子图。 That would make a total of three subplots stacked like a pyramid. 这将使总共三个子图像金字塔一样堆积。

How can I achieve this? 我该如何实现?

I'm not sure that this is exactly what you need but I believe GridSpec can be useful here. 我不确定这是否正是您所需要的,但是我相信GridSpec在这里可能会有用。 For example (from that page): 例如(从该页面):

ax1 = plt.subplot2grid((3, 3), (0, 0), colspan=3)
ax2 = plt.subplot2grid((3, 3), (1, 0), colspan=2)
ax3 = plt.subplot2grid((3, 3), (1, 2), rowspan=2)
ax4 = plt.subplot2grid((3, 3), (2, 0))
ax5 = plt.subplot2grid((3, 3), (2, 1))

Provide the following layout: 提供以下布局:

布局

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM