本文簡要介紹 python 語言中 matplotlib.pyplot.xlim
的用法。
-
獲取或設置當前坐標區的 x 限製。
調用簽名:
left, right = xlim() # return the current xlim xlim((left, right)) # set the xlim to left, right xlim(left, right) # set the xlim to left, right
如果不指定 args,則可以將
left
或right
作為 kwargs 傳遞,即:xlim(right=3) # adjust the right leaving left unchanged xlim(left=1) # adjust the left leaving right unchanged
設置限製會關閉 x 軸的自動縮放。
- 返回:
- 左右
-
新的 x 軸限製的元組。
注意
不帶參數調用此函數(例如
xlim()
)相當於在當前軸上調用get_xlim
的 pyplot。使用參數調用此函數相當於在當前軸上調用set_xlim
的 pyplot。所有參數都通過了。
用法
matplotlib.pyplot.xlim(*args, **kwargs)
相關用法
- Python matplotlib xticks用法及代碼示例
- Python matplotlib xkcd用法及代碼示例
- 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 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用法及代碼示例
- Python matplotlib Text.set_bbox用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.pyplot.xlim。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。