为什么我可以在我的cat_plot中使用col =添加颜色?
我正在尝试用我的cat_plot color blue制作线条。我尝试了以下代码,将col =靠近GEOM = C(“ line”)旁边:
library(interactions)
Figure01 <- cat_plot(M1, pred = "OA_status", geom = c("line", col = "blue"), interval = TRUE,
x.label = 'OA Status', y.label = 'Predicted Altmetric Score',
main.title = 'Figure 1')
Figure01
但是我只得到附加的图片。如您所见,该图中的线并不蓝色。我要在哪里出错 - col =在错误的地方?还是颜色参数不适用于这种类型的图?
I am trying to make the lines in my cat_plot color blue. I have tried the following code, putting the col = next to the geom = c("line"):
library(interactions)
Figure01 <- cat_plot(M1, pred = "OA_status", geom = c("line", col = "blue"), interval = TRUE,
x.label = 'OA Status', y.label = 'Predicted Altmetric Score',
main.title = 'Figure 1')
Figure01
But I am only getting the attached picture. As you can see, the lines are not blue in this plot. Where am I going wrong— is the col = in the wrong place? Or is the color argument not applicable for this type of plot?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将
钻石
数据集用作示例。您需要使用颜色
而不是col
。您可以做的是取决于因素的数量,例如这样的图:outupt:
I am using the
diamonds
dataset as an example. You need to usecolors
instead ofcol
. What you can do is depending on the number of factors is adding blue to your plot like this:Output: