yt.visualization.plot_modifications.MarkerAnnotateCallback

class yt.visualization.plot_modifications.MarkerAnnotateCallback(pos, marker='x', coord_system='data', plot_args=None)[source]

annotate_marker(pos, marker=’x’, coord_system=”data”, plot_args=None):

Overplot a marker on a position for highlighting specific features.

Parameters:

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

These are the coordinates where the marker will be overplotted

marker : string, optional

The shape of the marker to be passed to the MPL scatter function. By default, it is ‘x’, but other acceptable values are: ‘.’, ‘o’, ‘v’, ‘^’, ‘s’, ‘p’ ‘*’, etc. See matplotlib.markers for more information.

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 scatter function for generating the marker. By default, it is: {‘color’:’white’, ‘s’:50}

Examples

>>> # Overplot a white X on a feature at data location (0.5, 0.5, 0.5)
>>> import yt
>>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
>>> s = yt.SlicePlot(ds, 'z', 'density')
>>> s.annotate_marker([0.4, 0.5, 0.6])
>>> s.save()
>>> # Overplot a big yellow circle at axis location (0.1, 0.2)
>>> import yt
>>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
>>> s = yt.SlicePlot(ds, 'z', 'density')
>>> s.annotate_marker([0.1, 0.2], marker='o', coord_system='axis',
...                   plot_args={'color':'yellow', 's':200})
>>> s.save()

Methods