在 R 中是否有一种简单的方法可以使绘图的所有元素(轴、轴标签、网格线、刻度线......)以黑色背景着色为白色?我已经看到了一些制作黑色背景的选项,但我不知道如何重新着色情节元素。
我希望在一个相对复杂的情节上做到这一点。我的情节与使用 iris 数据集的“按组更改颜色”下的 scatter3D 示例非常相似。我已经包含了必要的代码来复制下面的那个图。
library(plot3D)
# Set up data
data(iris)
x <- sep.l <- iris$Sepal.Length
y <- pet.l <- iris$Petal.Length
z <- sep.w <- iris$Sepal.Width
# Make 3d scatterplot with colors by category
scatter3D(x, y, z, bty = "g", pch = 18,
col.var = as.integer(iris$Species),
col = c("#1B9E77", "#D95F02", "#7570B3"),
pch = 18, ticktype = "detailed",
colkey = list(at = c(2, 3, 4), side = 1,
addlines = TRUE, length = 0.5, width = 0.5,
labels = c("setosa", "versicolor", "virginica")) )