1 ggproto 对象

1.1 ggplot2 的内部结构

https://ggplot2-book.org/internals.html

Code
library(tidyverse)
df <- ToothGrowth
df$dose <- as.character(df$dose)
p <- ggplot(data = df,mapping = aes(dose,len,fill = supp)) +
  geom_bar(stat = "summary", fun = "mean",position = position_dodge(1))+
  coord_cartesian(ylim = c(0, 40))
p

1.2 图形坐标

Code
layer_data(plot = p ,i = 1) |> DT:::datatable()

1.3 ggproto

Code
prototype()
#> An object of class "classPrototypeDef"
#> Slot "object":
#> <S4 Type Object>
#> 
#> Slot "slots":
#> character(0)
#> 
#> Slot "dataPart":
#> [1] FALSE
Back to top