[英]How to change the colors of chart.Correlation from PerformanceAnalytics library in R?
I have an all numerical data frame in R
(no factors or levels) for which I'm trying to plot the correlation plot with the function chart.Correlation
from PerformanceAnalytics
library.我在
R
有一个全数字数据框(无因子或水平),我试图用函数chart.Correlation
从PerformanceAnalytics
库绘制相关图。 Documentation here文档在这里
The default colors are black and red.默认颜色为黑色和红色。 I want to be able to change the colors primarily and other attributes if possible.
如果可能,我希望能够主要更改颜色和其他属性。
The docs say that the function takes "any other passthru parameters into pairs."文档说该函数将“任何其他传递参数成对”。 I do not understand this statement.
我不明白这个说法。 I tried to pass some of the same parameters such as
bg="lightblue"
but absolutely no change.我尝试传递一些相同的参数,例如
bg="lightblue"
但绝对没有变化。
Any help would be very much appreciate it.任何帮助将不胜感激。
Update!更新!
For what is worth - I was able to get some of the things wanted with another library which is built on top of pairs
.对于什么是价值-我能得到一些与它是建立在顶部的另一个库想要的东西
pairs
。 Here is the code:这是代码:
library("psych")
pairs.panels(plot_data,
hist.col="#00FA9A",
show.points=TRUE,
stars=TRUE,
gap=0.05,
pch=".",
ellipses=FALSE,
scale=FALSE,
jiggle=TRUE,
factor=2,
main="Correlation",
col="#ADFF2F",
pty="m",
font=2)
I still do not know how to change the color of the data points - so there is your chance to get the points.我仍然不知道如何更改数据点的颜色 - 所以你有机会获得这些点。
要更改pairs.panels 函数(心理)中数据点的颜色,请查看帮助菜单中的示例:
pairs.panels(iris[1:4],bg=c("red","yellow","blue")[iris$Species], pch=21+as.numeric(iris$Species),main="Fisher Iris data by Species",hist.col="red")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.