geoplotlib
geoplotlib copied to clipboard
Histogram is not true histogram
When I use this function is does not do a true histogram for pandas data frames. It works for csv files only. Attached is a picture. Everywhere on the map it shows at each point the length of the data. Is this a color box plot using lat lon and Q(physical measurement)?
Hi
can you share your code?
@andrea-cuttone
import geoplotlib as glp
# df is a bigger pandas dataframe and the code for that is not posted here
df2["lon"] = df.lon.values
df2["lat"] = df.lat.values
data = df2
BoundingBox.SFC = BoundingBox(north=38.48, west=-123.3, south=37.32, east=-121)
glp.set_bbox(BoundingBox.SFC)
# plot save show
glp.hist(data, cmap=cmocean.cm.deep, scalemax=100, alpha=220, colorscale='sqrt', binsize=1.5)
glp.show()
you cannot use pandas dataframes directly, you first need to call DataAccessObject.from_dataframe, see https://github.com/andrea-cuttone/geoplotlib/blob/master/geoplotlib/utils.py