geoplotlib icon indicating copy to clipboard operation
geoplotlib copied to clipboard

Histogram is not true histogram

Open ghost opened this issue 7 years ago • 3 comments

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)? screenshot_2018-02-07_19-42-13

ghost avatar Feb 08 '18 03:02 ghost

Hi

can you share your code?

andrea-cuttone avatar Feb 10 '18 12:02 andrea-cuttone

@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()

ghost avatar Feb 10 '18 19:02 ghost

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

andrea-cuttone avatar Feb 18 '18 14:02 andrea-cuttone