本文簡要介紹 python 語言中 matplotlib.pyplot.subplot2grid
的用法。
-
在常規網格內的特定位置創建子圖。
- 參數:
- shape (整數,整數)
-
放置軸的網格的行數和列數。
- loc (整數,整數)
-
網格內軸位置的行號和列號。
- rowspan 整數,默認值:1
-
軸向下跨越的行數。
- colspan 整數,默認值:1
-
軸向右跨越的列數。
- fig
Figure
,可選 -
放置子圖的圖形。默認為當前圖形。
- **kwargs
-
其他關鍵字參數被傳遞給
add_subplot
。
- 返回:
Axes
-
子圖的軸。返回的 Axes 實際上可以是子類的實例,例如極坐標投影的
projections.polar.PolarAxes
。
注意
以下調用
ax = subplot2grid((nrows, ncols), (row, col), rowspan, colspan)
等同於
fig = gcf() gs = fig.add_gridspec(nrows, ncols) ax = fig.add_subplot(gs[row:row+rowspan, col:col+colspan])
用法
matplotlib.pyplot.subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs)
相關用法
- Python matplotlib subplots用法及代碼示例
- Python matplotlib subplot用法及代碼示例
- Python matplotlib silent_list用法及代碼示例
- Python matplotlib step用法及代碼示例
- Python matplotlib select_matching_signature用法及代碼示例
- Python matplotlib semilogx用法及代碼示例
- Python matplotlib semilogy用法及代碼示例
- Python matplotlib savefig用法及代碼示例
- Python matplotlib axvspan用法及代碼示例
- Python matplotlib Axes.get_legend_handles_labels用法及代碼示例
- Python matplotlib AbstractMovieWriter用法及代碼示例
- Python matplotlib triplot用法及代碼示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.hist用法及代碼示例
- Python matplotlib boxplot用法及代碼示例
- Python matplotlib InsetPosition用法及代碼示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代碼示例
- Python matplotlib Figure.set_size_inches用法及代碼示例
- Python matplotlib figlegend用法及代碼示例
- Python matplotlib Axes.step用法及代碼示例
- Python matplotlib Axes.contour用法及代碼示例
- Python matplotlib LassoSelector用法及代碼示例
- Python matplotlib BrokenBarHCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.plot用法及代碼示例
- Python matplotlib Axes.semilogx用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.pyplot.subplot2grid。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。