我正在使用带有 ggplot 的 geom_point() 来基本上创建一个 -coefplot- 的等价物,在一个绘图上具有 5 个不同模型的系数。
我可以只更改一个点(和相应的 CI 条)的颜色吗?颜色/字体/等呢?单个轴刻度标签?例如,如果我只想将 Model 3 标签的字体设为粗体,并将 Model 3 的系数点(+ CI 条)设为红色(或任何其他颜色来区分它)。我试过scale_fill_manual
了,但这似乎没有奏效。
我当前的代码(使用 scale_x_discrete,模型的名称只是模型 1、2、3 等,我将它们按顺序排列在那里):
ggplot(d, aes(x = var, y = coef)) +
geom_point() +
geom_pointrange(aes(ymin = cilow, ymax = ciupper)) +
scale_x_discrete(limits = model_order, labels = model_label) +
theme_minimal()