public
Created

hjustvjust

  • Download Gist
hjustvjust.r
R
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
 
hjustvjust <- expand.grid(
hjust=c(0, 0.5, 1),
vjust=c(0, 0.5, 1),
angle=c(0, 45, 90),
text="is-R"
)
 
hv <- ggplot(hjustvjust, aes(x=hjust, y=vjust)) +
geom_point() +
geom_text(aes(label=text, angle=angle, hjust=hjust, vjust=vjust)) +
facet_grid(~angle) +
scale_x_continuous(breaks=c(0, 0.5, 1), expand=c(0, 0.2)) +
scale_y_continuous(breaks=c(0, 0.5, 1), expand=c(0, 0.2)) + theme_bw()
 
hv + labs(title="Various values of angle, hjust and vjust in ggplot \n", y ="vjust \n", x =" \n hjust") +
theme(axis.text.x = element_text(colour="black",
size = 12,
face = "bold") ,
axis.text.y = element_text(colour="black",
size = 12,
face = "bold"),
axis.title.x = element_text(face="plain",
colour="black",
size=24),
axis.title.y = element_text(face="plain",
colour="black",
size=24),
plot.title = element_text(face="bold",
colour="black",
size=18))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.