class_docstr: The foundation of all animations.
  
  Parameters
  ----------
  blocks : list of animatplot.animations.Block
      A list of blocks to be animated
  timeline : Timeline or 1D array, optional
      If an array is passed in, it will be converted to a Timeline.
      If not given, a timeline will be created using the length of the
      first block.
  fig : matplotlib figure, optional
      The figure that the animation is to occur on
  
  Attributes
  ----------
  animation
      a matplotlib animation returned from FuncAnimation
class_docstr_tok: ["The","foundation","of","all","animations",".","Parameters","--","--","--","--","--","blocks",":","list","of","animatplot.animations.Block","A","list","of","blocks","to","be","animated","timeline",":","Timeline","or","1D","array",",","optional","If","an","array","is","passed","in",",","it","will","be","converted","to","a","Timeline",".","If","not","given",",","a","timeline","will","be","created","using","the","length","of","the","first","block",".","fig",":","matplotlib","figure",",","optional","The","figure","that","the","animation","is","to","occur","on","Attributes","--","--","--","--","--","animation","a","matplotlib","animation","returned","from","FuncAnimation"]
docstr: Creates a timeline slider.
  
  Parameters
  ----------
  text : str, optional
      The text to display for the slider. Defaults to 'Time'
  ax : matplotlib.axes.Axes, optional
      The matplotlib axes to attach the slider to.
  valfmt : str, optional
      a format specifier used to print the time
      Defaults to '%s' for datetime64, timedelta64 and '%1.2f' otherwise.
  color :
      The color of the slider.
docstr_tok: ["Creates","a","timeline","slider",".","Parameters","--","--","--","--","--","text",":","str",",","optional","The","text","to","display","for","the","slider",".","Defaults","to","'Time'","ax",":","matplotlib.axes.Axes",",","optional","The","matplotlib","axes","to","attach","the","slider","to",".","valfmt",":","str",",","optional","a","format","specifier","used","to","print","the","time","Defaults","to","'","%","s","'","for","datetime64",",","timedelta64","and","'","%","1.2f","'","otherwise",".","color",":","The","color","of","the","slider","."]
code: def timeline_slider(
      self, text="Time", ax=None, valfmt=None, color=None
  ):
      """Creates a timeline slider.
  
      Parameters
      ----------
      text : str, optional
          The text to display for the slider. Defaults to 'Time'
      ax : matplotlib.axes.Axes, optional
          The matplotlib axes to attach the slider to.
      valfmt : str, optional
          a format specifier used to print the time
          Defaults to '%s' for datetime64, timedelta64 and '%1.2f' otherwise.
      color :
          The color of the slider.
      """
      if ax is None:
          adjust_plot = {"bottom": 0.2}
          rect = [0.18, 0.05, 0.5, 0.03]
  
          plt.subplots_adjust(**adjust_plot)
          self.slider_ax = plt.axes(rect)
      else:
          self.slider_ax = ax
  
      if valfmt is None:
          if np.issubdtype(
              self.timeline.t.dtype, np.datetime64
          ) or np.issubdtype(self.timeline.t.dtype, np.timedelta64):
              valfmt = "%s"
          else:
              valfmt = "%1.2f"
  
      if self.timeline.log:
          valfmt = "$10^{%s}$" % valfmt
  
      self.slider = Slider(
          self.slider_ax,
          text,
          0,
          self.timeline._len - 1,
          valinit=0,
          valfmt=(valfmt + self.timeline.units),
          valstep=1,
          color=color,
      )
      self._has_slider = True
  
      def set_time(t):
          self.timeline.index = int(self.slider.val)
          self.slider.valtext.set_text(
              self.slider.valfmt % (self.timeline[self.timeline.index])
          )
          if self._pause:
              for block in self.blocks:
                  block._update(self.timeline.index)
              self.fig.canvas.draw()
  
      self.slider.on_changed(set_time)
  
file_path: animatplot/animatplot/animation.py
imports: from matplotlib.animation import FuncAnimation, PillowWriter
  from matplotlib.widgets import Button, Slider
  import matplotlib.pyplot
  import numpy
  from animatplot import Timeline
label_desc: Use image node_id 3 for calling the Animation obj's underlying member method code with example usage: obj.timeline_slider(text, ax, valfmt, color) without return types