yt.visualization.volume_rendering.camera.PerspectiveCamera.draw_line

PerspectiveCamera.draw_line(im, x0, x1, color=None)

Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.

Parameters:

im : ImageArray or 2D ndarray

Existing image that has the same resolution as the Camera, which will be painted by grid lines.

x0 : YTArray or ndarray

Starting coordinate. If passed in as an ndarray, assumed to be in code units.

x1 : YTArray or ndarray

Ending coordinate, in simulation coordinates. If passed in as an ndarray, assumed to be in code units.

color : array like, optional

Color of the line (r, g, b, a). Defaults to white.

Returns:

None :

Examples

>>> im = cam.snapshot() 
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')