本文簡要介紹 python 語言中 matplotlib.transforms.Transform.__sub__
的用法。
-
用
other
的倒數編寫self
,如果有的話,取消相同的項:# In general: A - B == A + B.inverted() # (but see note regarding frozen transforms below). # If A "ends with" B (i.e. A == A' + B for some A') we can cancel # out B: (A' + B) - B == A' # Likewise, if B "starts with" A (B = A + B'), we can cancel out A: A - (A + B') == B'.inverted() == B'^-1
取消(而不是天真地返回
A + B.inverted()
)很重要,原因有很多:-
它在計算 B 的逆時避免了浮點不準確性:
B - B
保證完全抵消(導致恒等變換),而B + B.inverted()
可能相差很小的 epsilon。 -
B.inverted()
總是返回一個凍結的變換:如果一個計算A + B + B.inverted()
並且後來發生了變異B
,那麽B.inverted()
將不會被更新並且最後兩個術語將不再抵消;另一方麵,即使B
發生突變,A + B - B
也將始終等於A
。
-
用法
__sub__(other)
相關用法
- Python matplotlib TriMesh.sticky_edges用法及代碼示例
- Python matplotlib TriMesh.set_hatch用法及代碼示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代碼示例
- Python matplotlib Text.set_bbox用法及代碼示例
- Python matplotlib TexManager.get_rgba用法及代碼示例
- Python matplotlib TextToPath.get_text_path用法及代碼示例
- Python matplotlib TwoSlopeNorm用法及代碼示例
- Python matplotlib Table.edges用法及代碼示例
- Python matplotlib TextPath用法及代碼示例
- Python matplotlib Table.set_fontsize用法及代碼示例
- 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 Figure.set_size_inches用法及代碼示例
- Python matplotlib figlegend用法及代碼示例
- Python matplotlib Axes.step用法及代碼示例
- Python matplotlib Axes.contour用法及代碼示例
- Python matplotlib LassoSelector用法及代碼示例
- Python matplotlib BrokenBarHCollection.set_hatch用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.transforms.Transform.__sub__。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。