yt.visualization.plot_modifications.SphereCallback

class yt.visualization.plot_modifications.SphereCallback(center, radius, circle_args=None, text=None, coord_system='data', text_args=None)[source]
annotate_sphere(center, radius, circle_args=None,
coord_system=’data’, text=None, text_args=None):

Overplot a circle with designated center and radius with optional text.

Parameters:

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

These are the coordinates where the circle will be overplotted

radius : YTArray, float, or (1, (‘kpc’)) style tuple

The radius of the circle in code coordinates

circle_args : dict, optional

This dictionary is passed to the MPL circle object. By default, {‘color’:’white’}

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

text : string, optional

Optional text to include next to the circle.

text_args : dictionary, optional

This dictionary is passed to the MPL text function. By default, it is: {‘color’:’white’}

Examples

>>> # Overplot a white circle of radius 100 kpc over the central galaxy
>>> import yt
>>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
>>> s = yt.SlicePlot(ds, 'z', 'density')
>>> s.annotate_sphere([0.5, 0.5, 0.5], radius=(100, 'kpc'))
>>> s.save()

Methods