本文簡要介紹 python 語言中 matplotlib.offsetbox.DraggableBase
的用法。
-
基礎:
object
可拖動藝術家的助手基類(圖例,偏移框)。
派生類必須覆蓋以下方法:
def save_offset(self): ''' Called when the object is picked for dragging; should save the reference position of the artist. ''' def update_offset(self, dx, dy): ''' Called during the dragging; (*dx*, *dy*) is the pixel offset from the point where the mouse drag started. '''
或者,您可以覆蓋以下方法:
def finalize_offset(self): '''Called when the mouse is released.'''
在
DraggableLegend
和DraggableAnnotation
的當前實現中,update_offset
將藝術家放置在顯示坐標中,finalize_offset
重新計算他們在軸坐標中的位置並設置相關屬性。
用法
class matplotlib.offsetbox.DraggableBase(ref_artist, use_blit=False)
相關用法
- Python matplotlib Dvi用法及代碼示例
- 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用法及代碼示例
- Python matplotlib Axes.inset_axes用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.offsetbox.DraggableBase。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。