docs: def plot_ltt(lineages, show_plot=True, color='#000000', xmin=None, xmax=None, ymin=None, ymax=None, title=None, xlabel=None, ylabel=None):
      '''Plot the Lineages Through Time (LTT) curve of a given tree
  
      Args:
          ``lineages`` (``dict``): The ``lineages`` dictionary returned by a ``Tree`` object's ``lineages_through_time()`` function call
  
          ``show_plot`` (``bool``): ``True`` to show the plot, otherwise ``False`` to only return the dictionary. To plot multiple LTTs on the same figure, set ``show_plot`` to False for all but the last plot.
  
          ``color`` (``str``): The color of the resulting plot
  
          ``title`` (``str``): The title of the resulting plot
  
          ``xmin`` (``float``): The minimum value of the horizontal axis in the resulting plot
  
          ``xmax`` (``float``): The maximum value of the horizontal axis in the resulting plot
  
          ``xlabel`` (``str``): The label of the horizontal axis in the resulting plot
  
          ``ymin`` (``float``): The minimum value of the vertical axis in the resulting plot
  
          ``ymax`` (``float``): The maximum value of the vertical axis in the resulting plot
  
          ``ylabel`` (``str``): The label of the vertical axis in the resulting plot
      '''
      import matplotlib.pyplot as plt; from matplotlib.ticker import MaxNLocator
      if 'TREESWIFT_FIGURE' not in globals():
          global TREESWIFT_FIGURE; TREESWIFT_FIGURE = None
      if TREESWIFT_FIGURE is None:
          TREESWIFT_FIGURE = plt.figure()
          TREESWIFT_FIGURE.gca().yaxis.set_major_locator(MaxNLocator(integer=True)) # integer y ticks
          TREESWIFT_FIGURE.XMIN = float('inf'); TREESWIFT_FIGURE.XMAX = float('-inf')
          TREESWIFT_FIGURE.YMIN = float('inf'); TREESWIFT_FIGURE.YMAX = float('-inf')
      times = sorted(lineages.keys())
      if times[0] < TREESWIFT_FIGURE.XMIN:
          TREESWIFT_FIGURE.XMIN = times[0]
      if times[-1] > TREESWIFT_FIGURE.XMAX:
          TREESWIFT_FIGURE.XMAX = times[-1]
      for i in range(len(times)-1):
          if i == 0:
              prev = 0
          else:
              prev = lineages[times[i-1]]
          if lineages[times[i]] > TREESWIFT_FIGURE.YMAX:
              TREESWIFT_FIGURE.YMAX = lineages[times[i]]
          if lineages[times[i]] < TREESWIFT_FIGURE.YMIN:
              TREESWIFT_FIGURE.YMIN = lineages[times[i]]
          TREESWIFT_FIGURE.gca().plot([times[i],times[i]], [prev,lineages[times[i]]], color=color)
          TREESWIFT_FIGURE.gca().plot([times[i],times[i+1]], [lineages[times[i]],lineages[times[i]]], color=color)
      if len(times) > 1:
          TREESWIFT_FIGURE.gca().plot([times[-1],times[-1]], [lineages[times[-2]],lineages[times[-1]]], color=color)
          if lineages[times[-1]] < TREESWIFT_FIGURE.YMIN:
              TREESWIFT_FIGURE.YMIN = lineages[times[-1]]
      if show_plot:
          if xmin is None:
              xmin = TREESWIFT_FIGURE.XMIN
          elif not isinstance(xmin,int) and not isinstance(xmin,float):
              warn("xmin is invalid, so using the default"); xmin = TREESWIFT_FIGURE.XMIN
          if xmax is None:
              xmax = TREESWIFT_FIGURE.XMAX
          elif not isinstance(xmax,int) and not isinstance(xmax,float):
              warn("xmax is invalid, so using the default"); xmax = TREESWIFT_FIGURE.XMAX
          plt.xlim(left=xmin, right=xmax)
          if ymin is None:
              ymin = TREESWIFT_FIGURE.YMIN
          elif not isinstance(ymin,int) and not isinstance(ymin,float):
              warn("ymin is invalid, so using the default"); ymin = TREESWIFT_FIGURE.YMIN
          if ymax is None:
              ymax = ceil(TREESWIFT_FIGURE.YMAX*1.1)
          elif not isinstance(ymax,int) and not isinstance(ymax,float):
              warn("ymax is invalid, so using the default"); ymax = ceil(TREESWIFT_FIGURE.YMAX*1.1)
          plt.ylim(bottom=ymin, top=ymax)
          if title is not None and not isinstance(title,str):
              warn("title is invalid, so using the default"); title = None
          if title is None:
              plt.title("Lineages Through Time")
          else:
              plt.title(title)
          if xlabel is not None and not isinstance(xlabel,str):
              warn("xlabel is invalid, so using the default"); xlabel = None
          if xlabel is None:
              plt.xlabel("Time")
          else:
              plt.xlabel(xlabel)
          if ylabel is not None and not isinstance(ylabel,str):
              warn("ylabel is invalid, so using the default"); ylabel = None
          if ylabel is None:
              plt.ylabel("Number of Lineages")
          else:
              plt.ylabel(ylabel)
          plt.show(); TREESWIFT_FIGURE = None