parameters: (mz: float, intensity: float, annotation: Optional[str],
                    color_ions: bool, annotate_ions: bool, matched: Optional[bool],
                    annotation_kws: Dict[str, object], ax)
return_statement: return color, zorder
docstring: Annotate a specific fragment peak.
  
      Parameters
      ----------
      mz : float
          The peak's m/z value (position of the annotation on the x axis).
      intensity : float
          The peak's intensity (position of the annotation on the y axis).
      annotation : Optional[MoleculeFragmentAnnotation,
                            PeptideFragmentAnnotation]
          The annotation that will be plotted.
      color_ions : bool
          Flag whether to color the peak annotation or not.
      annotate_ions : bool
          Flag whether to annotation the peak or not.
      annotation_kws : Dict
          Keyword arguments for `ax.text` to customize peak annotations.
      ax : plt.Axes
          Axes instance on which to plot the annotation.
  
      Returns
      -------
      Tuple[str, int]
          A tuple of the annotation's color as a hex string and the annotation's
          zorder.
docstring_summary: Annotate a specific fragment peak.
docstring_tokens: Annotate a specific fragment peak .
function: def _annotate_ion(mz: float, intensity: float, annotation: Optional[str],
                    color_ions: bool, annotate_ions: bool, matched: Optional[bool],
                    annotation_kws: Dict[str, object], ax) -> Tuple[str, int]:
      """
      Annotate a specific fragment peak.
  
      Parameters
      ----------
      mz : float
          The peak's m/z value (position of the annotation on the x axis).
      intensity : float
          The peak's intensity (position of the annotation on the y axis).
      annotation : Optional[MoleculeFragmentAnnotation,
                            PeptideFragmentAnnotation]
          The annotation that will be plotted.
      color_ions : bool
          Flag whether to color the peak annotation or not.
      annotate_ions : bool
          Flag whether to annotation the peak or not.
      annotation_kws : Dict
          Keyword arguments for `ax.text` to customize peak annotations.
      ax : plt.Axes
          Axes instance on which to plot the annotation.
  
      Returns
      -------
      Tuple[str, int]
          A tuple of the annotation's color as a hex string and the annotation's
          zorder.
      """
      # No annotation -> Just return peak styling information.
      if annotation is None:
          return colors.get(None), zorders.get(None)
      # Else: Add the textual annotation.
      ion_type = annotation[0]
      if ion_type not in colors:
          raise ValueError('Ion type not supported')
  
      color = (colors[ion_type] if color_ions else
               colors[None])
      zorder = zorders[ion_type]
  
      if matched is not None and not matched:
          color = '#aaaaaa'
  
      if annotate_ions:
          annotation_pos = intensity
          if annotation_pos > 0:
              annotation_pos += 0.02
          kws = annotation_kws.copy()
          del kws['zorder']
          ax.text(mz, annotation_pos, str(annotation), color=color,
                  zorder=zorder, **kws)
  
      return color, zorder
function_tokens: def _annotate_ion ( mz : float , intensity : float , annotation : Optional [ str ] , color_ions : bool , annotate_ions : bool , matched : Optional [ bool ] , annotation_kws : Dict [ str , object ] , ax ) -> Tuple [ str , int ] : # No annotation -> Just return peak styling information. if annotation is None : return colors . get ( None ) , zorders . get ( None ) # Else: Add the textual annotation. ion_type = annotation [ 0 ] if ion_type not in colors : raise ValueError ( 'Ion type not supported' ) color = ( colors [ ion_type ] if color_ions else colors [ None ] ) zorder = zorders [ ion_type ] if matched is not None and not matched : color = '#aaaaaa' if annotate_ions : annotation_pos = intensity if annotation_pos > 0 : annotation_pos += 0.02 kws = annotation_kws . copy ( ) del kws [ 'zorder' ] ax . text ( mz , annotation_pos , str ( annotation ) , color = color , zorder = zorder , * * kws ) return color , zorder