How to Display my Data in Observable Hexbin

I am experimenting with my own data in the Hexbin map (from the plot gallery). Here is the link: Plot: Hexbin map / Izzy Holmes | Observable

I’ve connected it to my vehicles tsv file. I want to now plot the hexbins. Not sure what I’m missing…

I am expecting bins to show on the map based on Electric(EV) values. So, larger values would be larger bins.

In the future please open a discussion on github, we’re trying to regroup all Plot support on that platform.

One issue in the code you post is that the longitude and latitude are mixed-up. You can fix that by switching x and y. And since the dataset has several dates, I figured we might want to make the size of the hexbin reflect their sum. This should get you started:

Plot.plot({
  projection: "albers-usa",
  marks: [
    Plot.geo(statemesh, {strokeOpacity: 0.5}),
    Plot.geo(nation),
    Plot.dot(vehicles, Plot.hexbin({r: "sum"}, {x: "1", y: "0", r: "Electric (EV)"}))
  ]
})
1 Like