Reputation: 7752
I'm trying to plot some data which broadly should form a map like so:
import numpy as np
lats = np.random.uniform(51.5, 51.6, 100)
lons = np.random.uniform(-0.1, 0.1, 100)
months = np.arange(1, 13)
vouchers = np.random.randint(1, 100, 100)
test_df = pd.DataFrame({
'lat': lats,
'lon': lons,
'month': np.random.choice(months, 100),
'vouchers': vouchers
})
test_df
alt.Chart(test_df).mark_circle().encode(
longitude='lon:Q',
latitude='lat:Q',
size='vouchers:Q',
color='month:N'
)
That looks like this:
Anyway, my real data is very similar.
Describe shows this:
and the data is the right dtypes:
Here's my code:
alt.Chart(lunch_vouchers).mark_circle().encode(
longitude='long_jittered:Q',
latitude='lat_jittered:Q',
size=alt.Size('Total_People_in_voucher:Q', scale=alt.Scale(range=[0, 1000]), legend=None),
color=alt.value('red'),
tooltip=['Postcode', 'Total_People_in_voucher', 'Month']
)
But it produces a strange display error in VS Code.
How can I fix this?
Upvotes: 1
Views: 43