amepproject / amep

The Active Matter Evaluation Package (AMEP) - a Python library for the analysis of particle-based and continuum simulation data of soft and active matter systems
https://amepproject.de/
GNU General Public License v3.0
12 stars 2 forks source link

FRQ: Plot arrows for annotations. #25

Open hechtprojects opened 6 months ago

hechtprojects commented 6 months ago

Proposed new feature or change:

Add the following method (+ docstring + example) to amep.plot:

def draw_arrow(fig, x, y, dx, dy, **kwargs):
    arrow = FancyArrow(x, y, dx, dy, transform=fig.transFigure, length_includes_head=True, **kwargs)
    fig.add_artist(arrow)

This allows to draw an arrow that points from (x, y) to (x+dx, y+dy), which is useful for annotation purposes.