code: def plot_landmarks(
      landmark_list: landmark_pb2.NormalizedLandmarkList,
      connections: Optional[List[Tuple[int, int]]] = None,
      landmark_drawing_spec: DrawingSpec = DrawingSpec(
          color=RED_COLOR, thickness=5
      ),
      connection_drawing_spec: DrawingSpec = DrawingSpec(
          color=BLACK_COLOR, thickness=5
      ),
      elevation: int = 10,
      azimuth: int = 10,
  ):
      """Plot the landmarks and the connections in matplotlib 3d.
  
      Args:
        landmark_list: A normalized landmark list proto message to be plotted.
        connections: A list of landmark index tuples that specifies how landmarks to
          be connected.
        landmark_drawing_spec: A DrawingSpec object that specifies the landmarks'
          drawing settings such as color and line thickness.
        connection_drawing_spec: A DrawingSpec object that specifies the
          connections' drawing settings such as color and line thickness.
        elevation: The elevation from which to view the plot.
        azimuth: the azimuth angle to rotate the plot.
  
      Raises:
        ValueError: If any connection contains an invalid landmark index.
      """
      if not landmark_list:
          return
      plt.figure(figsize=(10, 10))
      ax = plt.axes(projection="3d")
      ax.view_init(elev=elevation, azim=azimuth)
      plotted_landmarks = {}
      for idx, landmark in enumerate(landmark_list.landmark):
          if (
              landmark.HasField("visibility")
              and landmark.visibility < _VISIBILITY_THRESHOLD
          ) or (
              landmark.HasField("presence")
              and landmark.presence < _PRESENCE_THRESHOLD
          ):
              continue
          ax.scatter3D(
              xs=[-landmark.z],
              ys=[landmark.x],
              zs=[-landmark.y],
              color=_normalize_color(landmark_drawing_spec.color[::-1]),
              linewidth=landmark_drawing_spec.thickness,
          )
          plotted_landmarks[idx] = (
              -landmark.z,
              landmark.x,
              -landmark.y,
          )
      if connections:
          num_landmarks = len(landmark_list.landmark)
          # Draws the connections if the start and end landmarks are both visible.
          for connection in connections:
              start_idx = connection[0]
              end_idx = connection[1]
              if not (
                  0 <= start_idx < num_landmarks
                  and 0 <= end_idx < num_landmarks
              ):
                  raise ValueError(
                      f"Landmark index is out of range. Invalid connection "
                      f"from landmark #{start_idx} to landmark #{end_idx}."
                  )
              if (
                  start_idx in plotted_landmarks
                  and end_idx in plotted_landmarks
              ):
                  landmark_pair = [
                      plotted_landmarks[start_idx],
                      plotted_landmarks[end_idx],
                  ]
                  ax.plot3D(
                      xs=[landmark_pair[0][0], landmark_pair[1][0]],
                      ys=[landmark_pair[0][1], landmark_pair[1][1]],
                      zs=[landmark_pair[0][2], landmark_pair[1][2]],
                      color=_normalize_color(
                          connection_drawing_spec.color[::-1]
                      ),
                      linewidth=connection_drawing_spec.thickness,
                  )
      plt.show()
  
file_path: mediapipe/mediapipe/python/solutions/drawing_utils.py
imports: import dataclasses
  import math
  from typing import List, Mapping, Optional, Tuple, Union
  import cv2
  import matplotlib.pyplot
  import numpy
  from mediapipe.framework.formats import detection_pb2
  from mediapipe.framework.formats import landmark_pb2
  from mediapipe.framework.formats import location_data_pb2
label_desc: Use image node_id 6 for calling a global function with example usage: plot_landmarks(landmark_list, connections, landmark_drawing_spec, connection_drawing_spec, elevation, azimuth) without return types