import math
%pip install -q altair vega_datasets
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
print('clear this output!')
Note: you may need to restart the kernel to use updated packages.
clear this output!
pd.DataFrame(np.random.rand(4,4))
Loading...
plt.imshow(np.random.random((3,3)));
print("Hello Stream Output")
Hello Stream Output
import altair as alt
from vega_datasets import data
cars = data.cars()
cars.head()
Loading...
interval = alt.selection_interval()
scatter = alt.Chart(cars).mark_point().encode(
x='Horsepower:Q',
y='Miles_per_Gallon:Q',
color=alt.condition(interval, 'Origin:N', alt.value('lightgray'))
).add_selection(
interval
)
hist = alt.Chart(cars).mark_bar().encode(
x='count()',
y='Origin',
color='Origin'
).transform_filter(
interval
)
scatter & hist
Loading...