yt.visualization.plot_modifications.
LinePlotCallback
(p1, p2, data_coords=False, coord_system='data', plot_args=None)[source]¶annotate_line(p1, p2, coord_system=”data”, plot_args=None):
Overplot a line with endpoints at p1 and p2. p1 and p2 should be 2D or 3D coordinates consistent with the coordinate system denoted in the “coord_system” keyword.
Parameters: | p1, p2 : 2- or 3-element tuples, lists, or arrays
coord_system : string, optional
plot_args : dictionary, optional
|
---|
Examples
>>> # Overplot a diagonal white line from the lower left corner to upper
>>> # right corner
>>> import yt
>>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
>>> s = yt.SlicePlot(ds, 'z', 'density')
>>> s.annotate_line([0,0], [1,1], coord_system='axis')
>>> s.save()
>>> # Overplot a red dashed line from data coordinate (0.1, 0.2, 0.3) to
>>> # (0.5, 0.6, 0.7)
>>> import yt
>>> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
>>> s = yt.SlicePlot(ds, 'z', 'density')
>>> s.annotate_line([0.1, 0.2, 0.3], [0.5, 0.6, 0.7], coord_system='data',
plot_args={'color':'red', 'lineStyles':'--'})
>>> s.save()
Methods