<jupyter_start><jupyter_text>Some Notebook Possibilitieshttp://mpld3.github.io/examples/linked_brush.html<jupyter_code># uncomment the bottom line in this cell, change the final line of 
# the loaded script to `mpld3.display()` (instead of show).
# %load http://mpld3.github.io/_downloads/linked_brush.py<jupyter_output><empty_output><jupyter_text>Linked Brushing ExampleThis example uses the standard Iris dataset and plots it with a linked brushingtool for dynamically exploring the data. The paintbrush button at the bottomleft can be used to enable and disable the behavior.<jupyter_code>import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris

import mpld3
from mpld3 import plugins, utils
data = load_iris()
X = data.data
y = data.target
# dither the data for clearer plotting
X += 0.1 * np.random.random(X.shape)
fig, ax = plt.subplots(4, 4, sharex="col", sharey="row", figsize=(8, 8))
fig.subplots_adjust(left=0.05, right=0.95, bottom=0.05, top=0.95,
                    hspace=0.1, wspace=0.1)

for i in range(4):
    for j in range(4):
        points = ax[3 - i, j].scatter(X[:, j], X[:, i],
                                      c=y, s=40, alpha=0.6)

# remove tick labels
for axi in ax.flat:
    for axis in [axi.xaxis, axi.yaxis]:
        axis.set_major_formatter(plt.NullFormatter())

# Here we connect the linked brush plugin
plugins.connect(fig, plugins.LinkedBrush(points))

# mpld3.show()
mpld3.display()
%%writefile temp.py
fig, ax = plt.subplots(4, 4, sharex="col", sharey="row", figsize=(8, 8))
fig.subplots_adjust(left=0.05, right=0.95, bottom=0.05, top=0.95,
                    hspace=0.1, wspace=0.1)

for i in range(4):
    for j in range(4):
        points = ax[3 - i, j].scatter(X[:, j], X[:, i],
                                      c=y, s=40, alpha=0.6)

# remove tick labels
for axi in ax.flat:
    for axis in [axi.xaxis, axi.yaxis]:
        axis.set_major_formatter(plt.NullFormatter())

# Here we connect the linked brush plugin
plugins.connect(fig, plugins.LinkedBrush(points))

# mpld3.show()
mpld3.display()
!cat temp.py
_i6<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12686567164179105, 'fraction_numerical': 0.030783582089552237, 'mean_word_length': 3.5253164556962027, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '474948', 'license': 'MIT', 'n_tokens_mistral': 783, 'n_tokens_neox': 744, 'n_words': 212, 'path': 'deliver/02-Visualization-and-code organization.ipynb', 'repo_name': 'rlugojr/berkeley-jupyter-notebook', 'size': '2144'}