我有一个关于 geom_point 的问题。
ui <- fluidPage(
titlePanel("Test"),
sidebarLayout(sidebarPanel(
selectInput(
"selectedColX",
"Select colum for X axis",
choices = c("tooling1","tooling2"),
selected = "tooling1"
),
selectInput(
"selectedfill",
"Energie X is vulling",
choices = c("tooling1Energie","tooling2Energie"),
selected = "tooling1Energie"
) ,
selectInput(
"selectedColY",
"Select colum for Y axis",
choices = c("subject1","subject2"),
selected = "subject1"
) ,
selectInput(
"selectedcolor",
"Energie Y is omlijning",
choices = c("subject1Energie","subject2Energie"),
selected = "subject1Energie"
) ,
),
mainPanel(plotOutput("distPlot")))
)
server <- function(input, output) {
output$distPlot <- renderPlot({
x_axis <- input$selectedColX
y_axis <- input$selectedColY
fill <- input$selectedfill
color <- input$selectedcolor
gg <-
ggplot(KEK, aes_string(x = x_axis, y = y_axis, fill = fill, col = color))
gg <- gg + geom_col(size = 1.5) +
facet_wrap(~anoniem)
gg
})
}
当我使用此代码时,我可以深入了解,但使用 geom_col,不可能添加形状。所以我想我把它改成geom_point,但如果我这样做并添加形状并保持填充和颜色相同,那么填充会变成黑色(AccesEnergie)。见添加的图片。为什么会发生这种情况,有人可以帮我吗?