code: def ticks(
      ax,
      scale,
      ticks=None,
      locations=None,
      multiple=1,
      axis="b",
      offset=0.01,
      clockwise=False,
      axes_colors=None,
      fontsize=10,
      tick_formats=None,
      **kwargs,
  ):
      """
      Sets tick marks and labels.
  
      Parameters
      ----------
      ax: Matplotlib AxesSubplot, None
          The subplot to draw on.
      scale: float, 1.0
          Simplex scale size.
      ticks: list of strings, None
          The tick labels
      locations: list of points, None
          The locations of the ticks
      multiple: float, None
          Specifies which ticks gridelines to draw. For example, if scale=30 and
          multiple=6, only 5 ticks will be drawn.
      axis: str, 'b'
          The axis or axes to draw the ticks for. `axis` must be a substring of
          'lrb' (as sets)
      offset: float, 0.01
          controls the length of the ticks
      clockwise: bool, False
          Draw ticks marks clockwise or counterclockwise
      axes_colors: Dict, None
          Option to color ticks differently for each axis, 'l', 'r', 'b'
          e.g. {'l': 'g', 'r':'b', 'b': 'y'}
      tick_formats: None, Dict, Str
          If None, all axes will be labelled with ints. If Dict, the keys are
          'b', 'l' and 'r' and the values are format strings e.g. "%.3f" for
          a float with 3 decimal places or "%.3e" for scientific format with
          3 decimal places or "%d" for ints. If tick_formats is a string, it
          is assumed that this is a format string to be applied to all axes.
      kwargs:
          Any kwargs to pass through to matplotlib.
  
      """
  
      axis = axis.lower()
      valid_axis_chars = set(["l", "r", "b"])
      axis_chars = set(axis)
      if not axis_chars.issubset(valid_axis_chars):
          raise ValueError(
              "axis must be some combination of 'l', 'r', and 'b'"
          )
  
      if ticks and not locations:
          num_ticks = len(ticks)
          if num_ticks != 0:
              multiple = scale / (num_ticks - 1)
              locations = arange(0, scale + multiple, multiple)
  
      if not ticks:
          locations = arange(0, scale + multiple, multiple)
          ticks = locations
  
      tick_formats = normalize_tick_formats(tick_formats)
  
      # Default color: black
      if axes_colors is None:
          axes_colors = dict()
      for _axis in valid_axis_chars:
          if _axis not in axes_colors:
              axes_colors[_axis] = "black"
  
      offset *= scale
  
      if "r" in axis:
          for index, i in enumerate(locations):
              loc1 = (scale - i, i, 0)
              if clockwise:
                  # Right parallel
                  loc2 = (scale - i, i + offset, 0)
                  text_location = (scale - i, i + 2 * offset, 0)
                  tick = ticks[-(index + 1)]
              else:
                  # Horizontal
                  loc2 = (scale - i + offset, i, 0)
                  text_location = (
                      scale - i + 3.1 * offset,
                      i - 0.5 * offset,
                      0,
                  )
                  tick = ticks[index]
              line(ax, loc1, loc2, color=axes_colors["r"], **kwargs)
              x, y = project_point(text_location)
              if isinstance(tick, str):
                  s = tick
              else:
                  s = tick_formats["r"] % tick
              ax.text(
                  x,
                  y,
                  s,
                  horizontalalignment="center",
                  color=axes_colors["r"],
                  fontsize=fontsize,
              )
  
      if "l" in axis:
          for index, i in enumerate(locations):
              loc1 = (0, i, 0)
              if clockwise:
                  # Horizontal
                  loc2 = (-offset, i, 0)
                  text_location = (-2 * offset, i - 0.5 * offset, 0)
                  tick = ticks[index]
              else:
                  # Right parallel
                  loc2 = (-offset, i + offset, 0)
                  text_location = (-2 * offset, i + 1.5 * offset, 0)
                  tick = ticks[-(index + 1)]
              line(ax, loc1, loc2, color=axes_colors["l"], **kwargs)
              x, y = project_point(text_location)
              if isinstance(tick, str):
                  s = tick
              else:
                  s = tick_formats["l"] % tick
              ax.text(
                  x,
                  y,
                  s,
                  horizontalalignment="center",
                  color=axes_colors["l"],
                  fontsize=fontsize,
              )
  
      if "b" in axis:
          for index, i in enumerate(locations):
              loc1 = (i, 0, 0)
              if clockwise:
                  # Right parallel
                  loc2 = (i + offset, -offset, 0)
                  text_location = (i + 3 * offset, -3.5 * offset, 0)
                  tick = ticks[-(index + 1)]
              else:
                  # Left parallel
                  loc2 = (i, -offset, 0)
                  text_location = (i + 0.5 * offset, -3.5 * offset, 0)
                  tick = ticks[index]
              line(ax, loc1, loc2, color=axes_colors["b"], **kwargs)
              x, y = project_point(text_location)
              if isinstance(tick, str):
                  s = tick
              else:
                  s = tick_formats["b"] % tick
              ax.text(
                  x,
                  y,
                  s,
                  horizontalalignment="center",
                  color=axes_colors["b"],
                  fontsize=fontsize,
              )
  
file_path: python-ternary/ternary/lines.py
imports: from numpy import arange
  from matplotlib.lines import Line2D
  from .helpers import project_point
label_desc: Use image node_id 9 for calling a global function with example usage: ticks(ax, scale, ticks, locations, multiple, axis, offset, clockwise, axes_colors, fontsize, tick_formats) without return types