class_docstr: Context manager to change backend temporarily in ipython sesson.
  
  It uses ipython magic to change temporarily from the ipython inline backend to
  an interactive backend of choice. It cannot be used outside ipython sessions nor
  to change backends different than inline -> interactive.
  
  Notes
  -----
  The first time ``interactive_backend`` context manager is called, any of the available
  interactive backends can be chosen. The following times, this same backend must be used
  unless the kernel is restarted.
  
  Parameters
  ----------
  backend : str, optional
      Interactive backend to use. It will be passed to ``%matplotlib`` magic, refer to
      its docs to see available options.
  
  Examples
  --------
  Inside an ipython session (i.e. a jupyter notebook) with the inline backend set:
  
  .. code::
  
      >>> import arviz as az
      >>> idata = az.load_arviz_data("centered_eight")
      >>> az.plot_posterior(idata) # inline
      >>> with az.interactive_backend():
      ...     az.plot_density(idata) # interactive
      >>> az.plot_trace(idata) # inline
class_docstr_tok: ["Context","manager","to","change","backend","temporarily","in","ipython","sesson",".","It","uses","ipython","magic","to","change","temporarily","from","the","ipython","inline","backend","to","an","interactive","backend","of","choice",".","It","can","not","be","used","outside","ipython","sessions","nor","to","change","backends","different","than","inline","-",">","interactive",".","Notes","--","--","-","The","first","time","``","interactive_backend","``","context","manager","is","called",",","any","of","the","available","interactive","backends","can","be","chosen",".","The","following","times",",","this","same","backend","must","be","used","unless","the","kernel","is","restarted",".","Parameters","--","--","--","--","--","backend",":","str",",","optional","Interactive","backend","to","use",".","It","will","be","passed","to","``","%","matplotlib","``","magic",",","refer","to","its","docs","to","see","available","options",".","Examples","--","--","--","--","Inside","an","ipython","session","(","i.e",".","a","jupyter","notebook",")","with","the","inline","backend","set",":","..","code",":",":",">",">",">","import","arviz","as","az",">",">",">","idata","=","az.load_arviz_data","(","``","centered_eight","''",")",">",">",">","az.plot_posterior","(","idata",")","#","inline",">",">",">","with","az.interactive_backend","(",")",":","...","az.plot_density","(","idata",")","#","interactive",">",">",">","az.plot_trace","(","idata",")","#","inline"]
docstr: Enter context manager.
docstr_tok: ["Enter","context","manager","."]
code: def __enter__(self):
      """Enter context manager."""
      return self
  
imports: import functools
  import importlib
  import importlib.resources
  import re
  import warnings
  from functools import lru_cache
  import matplotlib.pyplot
  import numpy
  from numpy import newaxis
  from .rcparams import rcParams
label_desc: Use image node_id 2 for calling the interactive_backend obj's underlying member method code with example usage: obj.__enter__() and returns: self