I need to customize axis tick marks and tick labels of hexbin plot:
Hexbinning data which best are transformed prior to binning:
library(hexbin)
set.seed(25)
df<-data.frame(x=(rnorm(10000, mean=10, sd=1))^2,y=(rnorm(10000, mean=10, sd=1))^2)
hbo <- hexbin(sqrt(df))
The according plot would then be
plot(hbo,legend=FALSE,xlab="sqrt(x)",ylab="sqrt(y)",main="Transformed data")
I want to backtransform axis tick labels, so that annoying ... ,xlab="sqrt(x)",ylab="sqrt(y)", ...
could then be "x" and "y" again.
For base grafics derived plots, one might suppress the axis (x-axis only here) by
plot(hbo,legend=FALSE,main="Quasi-backtranformed data",xaxt="n")
and then issue
axis(side=1,at=seq(6,14,2),labels=seq(6,14,2)^2)
to recreate the respective axis with backtransformed labels.
But this does NOT work. It does nothing. The hexbin plot method does indeed not honor most par
arguments from generic plotting as assumed by @BondedDust.
Then, hexbin docs say it uses the grid-package for plotting. Having not worked with grid, I didn't do that good so far and I feel like a total doof.
library(grid)
grid.xaxis(at = seq(6,14,2), vp = viewport(w = .5, h = 0.01), name = "gxa")
again is unresponsive (please don't yell at me).
Above that, axis labels of plot(hexbin-objects) usually overlap with ticklabels, so I would be grateful for a non-Illustrator based method to create fancy hexbin-plots.
Advice on hexbin::tick_mark_and_tick_label_manipulation is greatly appreciated.