Open davidorme opened 3 years ago
I've encountered a similar issue. Changing x@xbnds
or x@ybndschanges the axis labels but does not move the boundaries of the plot (like
xlimor
ylim` would be expected to) so they are mislabelled.
If it is possible to pass xlim
and ylim
directly from hexbinplot()
or gplot.hexbin()
this would be ideal. My use case is the y-axis and colour scale on a log scale.
I'm using
hexbin
to create some plots with overlays and shared axes and have ended up going back to the baregrid
commands. I've run into an issue with setting bounds on viewports. The usage forhexViewport
is:The documentation for reports:
where
x
is a hexbin object. The user can supplyxbnds
andybnds
tohexbin
but these are not respected byhexViewport
. The values are inx
are first passed throughhexbin:::smartBnds
which does some smart stuff to do with shape but completely hamstrings any user attempt to control the viewport bounds.The relevant lines are ( https://github.com/edzer/hexbin/blob/master/R/hexViewport.R#L116):
So, the user can enforce bounds directly in
hexViewport
but not - as the documentation suggests - viahexbin
. This isn't simple - because the bounds for creating the bins and displaying them are conceptually different. I'm finding that in order to get my expected behaviour, I have to set the bounds in both locations:Honestly, I don't see a simple code fix - but maybe an update to the docs to highlight this?