yt.visualization.plot_modifications.ArrowCallback

class yt.visualization.plot_modifications.ArrowCallback(pos, code_size=None, length=0.03, coord_system='data', plot_args=None)[source]

annotate_arrow(pos, length=0.03, coord_system=’data’, plot_args=None):

Overplot an arrow pointing at a position for highlighting a specific feature. Arrow points from lower left to the designated position with arrow length “length”.

Parameters:

pos : 2- or 3-element tuple, list, or array

These are the coordinates to which the arrow is pointing

length : float, optional

The length, in axis units, of the arrow.

coord_system : string, optional

This string defines the coordinate system of the coordinates of pos Valid coordinates are:

“data” – the 3D dataset coordinates

“plot” – the 2D coordinates defined by the actual plot limits

“axis” – the MPL axis coordinates: (0,0) is lower left; (1,1) is

upper right

“figure” – the MPL figure coordinates: (0,0) is lower left, (1,1)

is upper right

plot_args : dictionary, optional

This dictionary is passed to the MPL arrow function for generating the arrow. By default, it is: {‘color’:’white’, ‘linewidth’:2}

Examples

>>> # Overplot an arrow pointing to feature at data coord: (0.2, 0.3, 0.4)
>>> import yt
>>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
>>> s = yt.SlicePlot(ds, 'z', 'density')
>>> s.annotate_arrow([0.2,0.3,0.4])
>>> s.save()
>>> # Overplot a red arrow with longer length pointing to plot coordinate 
>>> # (0.1, -0.1)
>>> import yt
>>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
>>> s = yt.SlicePlot(ds, 'z', 'density')
>>> s.annotate_arrow([0.1, -0.1, length=0.06, coord_system='plot', 
...                  plot_args={'color':'red'})
>>> s.save()

Methods