Open stelios-c opened 2 years ago
Hello, I don't think this is a bug. The hexagon is getting small because it would have to adjust its size to fit data that is so close to each other. Perhaps, you could adjust the grid-size, xlim, and ylim to make the graph look better?
Thanks @Copastr . I'm trying to do an A/B type comparison so I want xlim and ylim to be the same. But I agree, it looks like grid size needs to be adjusted to the range of the data. Maybe this should be treated as a documentation bug because https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.plot.hexbin.html only says
gridsizeint or tuple of (int, int), default 100 The number of hexagons in the x-direction. The corresponding number of hexagons in the y-direction is chosen in a way that the hexagons are approximately regular. Alternatively, gridsize can be a tuple with two elements specifying the number of hexagons in the x-direction and the y-direction.
This does not clarify that the hexagons are not all the way to xlim/ylim but only to the extent covered by the data.
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[ ] I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
Issue Description
csv_data gets plotted with big hexagons touching each other as expected. csv_data2 gets plotted with much smaller hexagons, probably because there is no data near the right xlim, upper ylim.
Expected Behavior
I was expecting the same size of hexagon for those two datasets
Installed Versions