作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想要将一组子图分为三行,第一行有一个子图,第二行有两个,第三行有三个。我做了以下事情:
fig, axes = plt.subplots(figsize=(10, 10), sharex=True, sharey=True, ncols=3, nrows=3)
x = np.linspace(0, 10, 100)
for i in range(3):
for j in range(0, i+1):
axes[i, j].plot(x, np.sin((i+j) *x))
如何删除三个空地 block ?
最佳答案
这个怎么样?
fig, axes = plt.subplots(figsize=(10, 10), sharex=True, sharey=True, ncols=3, nrows=3)
x = np.linspace(0, 10, 100)
for i in range(3):
for j in range(3):
if i<j:
axes[i, j].axis('off')
else:
axes[i, j].plot(x, np.sin((i+j) *x))
它似乎产生了您正在寻找的情节:
关于python - Matplotlib : How to get a triangular matrix of subplots?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42038563/
我是一名优秀的程序员,十分优秀!