
Matplotlib-优雅地使用subplot绘制组图
Axes是个二元数组,但是如果只有一行或者一列,就是一元数组。
1 | fig, ax = plt.subplots(2, 3, sharex='col', sharey='row') |
比起 plt.subplot(), plt.subplots() 用的0开始的index,这更pythonic。
1 | for i in range(1, 7): |
当然,还有一种奇技淫巧:
1 | from itertools import product |
This piece of writing is an original article, utilizing theCC BY-NC-SA 4.0Agreement. For complete reproduction, please acknowledge the source as Courtesy ofRoy's Base
Comment



