code: def _plot_dipole_3d(
      dipoles, *, coord_frame, color, fig, trans, scale, mode
  ):
      from .backends.renderer import _get_renderer
  
      _check_option("coord_frame", coord_frame, ("head", "mri"))
      color = "r" if color is None else color
      scale = 0.005 if scale is None else scale
      renderer = _get_renderer(fig=fig, size=(600, 600))
      pos = dipoles.pos
      ori = dipoles.ori
      if coord_frame != "head":
          trans = _get_trans(trans, fro="head", to=coord_frame)[0]
          pos = apply_trans(trans, pos)
          ori = apply_trans(trans, ori)
  
      renderer.sphere(center=pos, color=color, scale=scale)
      if mode == "arrow":
          x, y, z = pos.T
          u, v, w = ori.T
          renderer.quiver3d(
              x,
              y,
              z,
              u,
              v,
              w,
              scale=3 * scale,
              color=color,
              mode="arrow",
          )
      renderer.show()
      fig = renderer.scene()
      return fig
  
file_path: mne-python/mne/viz/_dipole.py
imports: import os.path
  import numpy
  from scipy.spatial import ConvexHull
  from .._freesurfer import _estimate_talxfm_rigid, _get_head_surface
  from ..surface import read_surface
  from ..transforms import _get_trans, apply_trans, invert_transform
  from ..utils import _check_option, _validate_type, get_subjects_dir
  from .utils import _validate_if_list_of_axes, plt_show
label_desc: Use image node_id 3 for calling a global function with example usage: _plot_dipole_3d(dipoles) and returns: fig