本文簡要介紹 python 語言中 matplotlib._api.deprecation.rename_parameter
的用法。
-
指示
func
的參數old
的裝飾器重命名為new
。func
的實際實現應該使用new
,而不是old
。如果將old
傳遞給func
,則會發出 DeprecationWarning 並使用其值,即使new
也通過關鍵字傳遞(這是為了簡化 pyplot 包裝函數,它總是顯式傳遞new
到軸方法)。如果new
也被傳遞但在位置上,則在參數綁定期間底層函數將引發 TypeError。例子
@_api.rename_parameter("3.1", "bad_name", "good_name") def func(good_name): ...
用法
matplotlib._api.deprecation.rename_parameter(since, old, new, func=None)
相關用法
- Python matplotlib register_cmap用法及代碼示例
- Python matplotlib relativedelta用法及代碼示例
- Python matplotlib rc用法及代碼示例
- Python matplotlib rgrids用法及代碼示例
- Python matplotlib rc_context用法及代碼示例
- 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用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib._api.deprecation.rename_parameter。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。