本文簡要介紹 python 語言中 matplotlib.pyplot.axes
的用法。
-
將 Axes 添加到當前圖形並使其成為當前 Axes。
調用簽名:
plt.axes() plt.axes(rect, projection=None, polar=False, **kwargs) plt.axes(ax)
- 參數:
- arg 無或 4 元組
-
此函數的確切行為取決於類型:
-
None
:使用subplot(**kwargs)
添加新的全窗口軸。 -
4 元組浮點數
rect
=(left, bottom, width, height)
。使用當前圖窗上的add_axes
添加一個新軸,其尺寸為rect
,采用標準化 (0, 1) 單位。
-
- projection {無,'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear',str},可選
-
Axes
的投影類型。str
是自定義投影的名稱,請參閱projections
。默認無導致 'rectilinear' 投影。 - polar 布爾值,默認值:假
-
如果為真,則相當於投影='polar'。
- sharex, sharey
Axes
,可選 -
與 sharex 和/或 sharey 共享 x 或 y
axis
。該軸將具有與共享軸相同的限製、刻度和比例。 - label str
-
返回軸的標簽。
- 返回:
-
Axes
或Axes
的子類 -
返回的坐標區類取決於使用的投影。如果使用直線投影,則為
Axes
,如果使用極坐標投影,則為projections.polar.PolarAxes
。
-
- 其他參數:
- **kwargs
-
此方法還采用返回的 Axes 類的關鍵字參數。直線 Axes 類
Axes
的關鍵字參數可在下表中找到,但如果使用另一個投影,也可能存在其他關鍵字參數,請參閱實際的 Axes 類。屬性
說明
{'box', 'datalim'}
一個過濾器函數,它接受一個 (m, n, 3) 浮點數組和一個 dpi 值,並返回一個 (m, n, 3) 數組和距圖像左下角的兩個偏移量
標量或無
(浮點數、浮點數)或 {'C'、'SW'、'S'、'SE'、'E'、'NE'、...}
bool
{'auto', 'equal'} 或浮點數
bool
unknown
unknown
可調用[[軸,渲染器],Bbox]
布爾或'line'
浮點數或無
BboxBase
或無bool
補丁或(路徑,變換)或無
facecolor
或 fccolor
bool
str
bool
object
bool
bool
unknown
None 或 bool 或 float 或可調用
[左、下、寬、高]或
Bbox
浮點數或無
bool
(比例:浮點數,長度:浮點數,隨機性:浮點數)
布爾或無
unknown
str
str
bool
(下:浮點數,上:浮點數)
str
(左:浮點數,右:浮點數)
浮點數大於 -0.5
unknown
unknown
unknown
(下:浮點數,上:浮點數)
str
(底部:浮點數,頂部:浮點數)
浮點數大於 -0.5
unknown
unknown
unknown
float
例子
# Creating a new full window Axes plt.axes() # Creating a new Axes with specified dimensions and a grey background plt.axes((left, bottom, width, height), facecolor='grey')
用法
matplotlib.pyplot.axes(arg=None, **kwargs)
相關用法
- Python matplotlib axvspan用法及代碼示例
- Python matplotlib axline用法及代碼示例
- Python matplotlib axis用法及代碼示例
- Python matplotlib arrow用法及代碼示例
- 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 subplots用法及代碼示例
- 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用法及代碼示例
- Python matplotlib Axes.semilogy用法及代碼示例
- Python matplotlib MovieWriterRegistry.register用法及代碼示例
- Python matplotlib PolyQuadMesh.set_hatch用法及代碼示例
- Python matplotlib warn_deprecated用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.pyplot.axes。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。