p <- ggplot(mtcars, aes(mpg, wt, colour = cyl)) + geom_point()
p + labs(colour = "Cylinders")
p + labs(x = "New x label")

# The plot title appears at the top-left, with the subtitle
# display in smaller text underneath it
p + labs(title = "New plot title")
p + labs(title = "New plot title", subtitle = "A subtitle")

# The caption appears in the bottom-right, and is often used for
# sources, notes or copyright
p + labs(caption = "(based on data from ...)")

# The plot tag appears at the top-left, and is typically used
# for labelling a subplot with a letter.
p + labs(title = "title", tag = "A")

# If you want to remove a label, set it to NULL.
p + labs(title = "title") + labs(title = NULL)

require(tidyverse)

data <- diamonds %>%
sample_n(1000)

ggplot(data = data) +
geom_point(aes(x = carat, y = price, color =price))+
labs(title = "AThis is title",
subtitle = "BThis is subtitle",
caption = "CThis is caption",
tag = "DThis is a tag",
x = "Enew x label",
y = "FNew y label")

 

p+labs(title = "New plot title", subtitle = "A subtitle",caption = "(based on data from ...)", tag = "A")

 

ggplot2 的标题、小标题、题注、附注

 

 ggplot2 的标题、小标题、题注、附注

 

 ggplot2 的标题、小标题、题注、附注

 

ggplot2 的标题、小标题、题注、附注

 

 ggplot2 的标题、小标题、题注、附注

 

 ggplot2 的标题、小标题、题注、附注

ggplot2 的标题、小标题、题注、附注

 

相关文章:

  • 2021-12-02
  • 2021-04-09
  • 2021-07-21
  • 2022-01-03
  • 2022-01-27
  • 2022-12-23
  • 2021-07-13
  • 2021-07-30
猜你喜欢
  • 2021-05-04
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2021-12-14
  • 2022-12-23
  • 2021-06-25
相关资源
相似解决方案