ggplot 修改坐标轴名称

  • 添加xlab、ylab
  • 添加labs
  • 在标度处(如scale_x_continus)修改

来源:https://zhuanlan.zhihu.com/p/92473504

library(ggplot2)

library(gcookbook)

hwplot <- ggplot(heightweight, aes(x = ageYear, y = heightIn, colour = sex)) +
geom_ponit( )
hw_plot +

xlab("Age in years") +

ylab("Height in inches")
hw_plot +

labs(x = "New x", y = "New y")
hw_plot +

scale_x_continuous(name = "New x change by sclae")

你可能感兴趣的:(R语言/Python画图,r语言,开发语言)