<jupyter_start><jupyter_text>Faceted Scatter Plot with Linked Brushing-----------------------------------------This is an example of using an interval selection to control the color ofpoints across multiple facets.<jupyter_code># category: interactive

import altair as alt
alt.data_transformers.enable('json')
from vega_datasets import data

cars = data.cars()

brush = alt.selection(type='interval', resolve='global')

base = alt.Chart(cars).mark_point().encode(
    y='Miles_per_Gallon',
    color=alt.condition(brush, 'Origin', alt.ColorValue('gray'))
).properties(
    selection=brush,
    width=250,
    height=250
)

base.encode(x='Horsepower') | base.encode(x='Acceleration')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17251051893408134, 'fraction_numerical': 0.008415147265077139, 'mean_word_length': 4.3283582089552235, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '278747', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 226, 'n_tokens_neox': 214, 'n_words': 50, 'path': 'notebooks/examples/scatter_linked_brush.ipynb', 'repo_name': 'rdhyee/altair_notebooks', 'size': '713'}