geoplotlib icon indicating copy to clipboard operation
geoplotlib copied to clipboard

custom Heatmap style DotDensity layer

Open timgrossmann opened this issue 6 years ago • 0 comments

Hi 👋

I'm trying to create a visualisation in which the dots are all coloured according to a given variable, e.g. the price of an accommodation. Each dot should represent this price with a color mapped to a colormap.

Currently my approach is this:

...

for id in self.data['id']:
            grp = self.data.where(self.data['id'] == id)
            color = self.cmap.to_color(max('price'], 1), max_val, 'log')
            self.painter.set_color(color)
            
            x, y = proj.lonlat_to_screen(grp['lon'], grp['lat'])
            self.painter.points(x, y, 5)

...

However, this is very inefficient and nearly freezes the visualisation... Do you have any proposal on how to do that @andrea-cuttone ?

Thank you very much Best Tim

timgrossmann avatar Jan 29 '19 19:01 timgrossmann