<jupyter_start><jupyter_text>Choosing the backend *echelle* provides support for two different backends when dealing with interactivity. The default backend is *bokeh*, due to its good performance. The fall-back is to use the *matplotlib* widgets. The only time I recommend choosing *matplotlib* is a backend is when you are working outside of a Jupyter notebook environment (i.e., accessing echelle from the terminal).  Let's use the same star from our previous example:<jupyter_code>import lightkurve as lk
lc = lk.search_lightcurve('KIC 11615890').download_all().stitch()
pg = lc.to_periodogram(normalization='psd')
freq, amp = pg.frequency.value, pg.power.value<jupyter_output><empty_output><jupyter_text>Bokeh *Bokeh* is the default backend for *echelle*. When using *Bokeh*, you will need to pass in the URL of the notebook if there are multiple notebooks open. *echelle* will warn you about this.<jupyter_code>import echelle
echelle.interact_echelle(freq, amp, 5, 10)<jupyter_output>/Users/daniel/Dropbox (Sydney Uni)/code/echelle/echelle/interact.py:192: UserWarning: You have multiple Jupyter servers open.             You will need to pass the current notebook to `notebook_url`.             i.e. interact_echelle(x,y,notebook_url='http://localhost:8888')
  UserWarning,<jupyter_text>Matplotlib Matplotlib has no such constraints and can work from the terminal or in a Jupyter notebook. If you use matplotlib from a notebook you must set the following cell magic:<jupyter_code>%matplotlib notebook<jupyter_output><empty_output><jupyter_text>If you want the cells to "pop out" from the notebook and appear as a separate window, you need to instead call:<jupyter_code>%matplotlib qt
echelle.interact_echelle(freq, amp, 5, 10, backend='matplotlib')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08179271708683473, 'fraction_numerical': 0.011764705882352941, 'mean_word_length': 5.7908745247148286, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '63015', 'license': 'MIT', 'n_tokens_mistral': 581, 'n_tokens_neox': 556, 'n_words': 198, 'path': 'docs/notebooks/backend.ipynb', 'repo_name': 'danielhey/Echelle', 'size': '1785'}