mpl_interactions.interactive_axvline

interactive_axvline(x=0, ymin=0, ymax=1, ax=None, slider_formats=None, title=None, force_ipywidgets=False, play_buttons=False, play_button_pos='right', controls=None, display_controls=True, **kwargs)[source]

Control a vertical line using widgets.

Parameters
  • x (float or function) – x position in data coordinates of the horizontal line.

  • ymin (float or function) – Should be between 0 and 1, 0 being the bottom of the plot, 1 the far top of the plot

  • ymax (float or function) – Should be between 0 and 1, 0 being the top of the plot, 1 the top of the plot.

  • ax (matplotlib axis, optional) – If None a new figure and axis will be created

  • slider_formats (None, string, or dict) – If None a default value of decimal points will be used. Uses the new {} style formatting

  • force_ipywidgets (boolean) – If True ipywidgets will always be used, even if not using the ipympl backend. If False the function will try to detect if it is ok to use ipywidgets If ipywidgets are not used the function will fall back on matplotlib widgets

  • play_buttons (bool or dict, optional) – Whether to attach an ipywidgets.Play widget to any sliders that get created. If a boolean it will apply to all kwargs, if a dictionary you choose which sliders you want to attach play buttons too.

  • play_button_pos (str, or dict, or list(str)) – ‘left’ or ‘right’. Whether to position the play widget(s) to the left or right of the slider(s)

  • controls (mpl_interactions.controller.Controls) – An existing controls object if you want to tie multiple plot elements to the same set of controls

  • display_controls (boolean) – Whether the controls should display themselve on creation. Ignored if controls is specified.

Returns

controls