NicolasBourbaki
NicolasBourbaki

Reputation: 987

Changing size of axis labels in hexbin plot

Is there a way to change the font size of axis labels when plotting hexbin data?

library(hexbin)
myData <- hexbin(rnorm(100), rnorm(100)) 
myPlot <- plot(myData, xlab = "Variable 1", ylab = "Variable 2")

enter image description here

Upvotes: 1

Views: 629

Answers (1)

dcarlson
dcarlson

Reputation: 11076

You can suppress the labels and add them separately with grid commands. It may take some trial and error to position them exactly where you want them:

library(grid)
myPlot <- plot(myData, xlab="", ylab="", lcex=.75)
grid.text("Variable 1", .45, .1, gp=gpar(fontsize=12))
grid.text("Variable 2", .05, .5, rot=90, gp=gpar(fontsize=12))

Hexbin Plot

Upvotes: 2

Related Questions