一般来说,fill
定义几何图形的颜色filled, 然而colour定义几何图形的颜色outlined(形状的“笔触”,用Photoshop语言来说)。
Points 一般来说只有颜色而没有填充,因为,你知道——它们只是点。然而,包含颜色和填充的点形状 21–25 http://ggplot2.tidyverse.org/reference/geom_point.html。例如:
library(tidyverse)
df = data_frame(x = 1:5, y = x^2)
ggplot(df) +
geom_point(
aes(x, y, fill = x),
shape = 21, size = 4, colour = 'red')
这是一个例子ggmap
,其中两者fill
and colour
已设置(但未映射到美学):
library("ggmap")
us = c(left = -125, bottom = 25.75, right = -67, top = 49)
map = get_stamenmap(us, zoom = 5, maptype = "toner-lite")
df2 = data_frame(
x = c(-120, -110, -100, -90, -80),
y = c(30, 35, 40, 45, 40))
ggmap(map) +
geom_point(
aes(x, y), data = df2,
shape = 21, fill = 'blue', colour = 'red', size = 4)
但除非你使用那些特殊的形状,否则如果你使用一个点,给它一个colour
, not a fill
(因为大多数点都没有)。