简体   繁体   English

如何更改R中PerformanceAnalytics库中chart.Correlation的颜色?

[英]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.CorrelationPerformanceAnalytics库绘制相关图。 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.

相关问题 如何增加 PerformanceAnalytics::chart.Correlation 和断线中变量名称的大小? - How to increase the size of the name of variables in PerformanceAnalytics::chart.Correlation and break line? 无法更改 R 图中的 pch(点符号)。相关性 - cannot change pch (point symbol) in R chart.Correlation 如何从chart.correlation函数中删除有效星 - How to remove significance stars from chart.correlation function 更改图表。相关默认为生成最佳拟合线而不是下三角形中的平滑曲线[R] - change chart.Correlation defaults to produce best fit line rather than smoothed curve in lower triangle [R] 如何使用ggplot2包创建此图表.R中的相关图? - How can I create this chart.Correlation graph in R using the ggplot2 package? 更改图表下对角线上的点字符。相关() - Change point characters in lower diagonal of chart.Correlation() 图表与连续和类别变量的相关性 - chart.Correlation with continious and categorical variables R ggplot2 是否有等效于 Performance Analytics 包中的 chart.Correlation 函数? - R ggplot2 is there are equivalent to the chart.Correlation function in the Performance Analytics package? 我如何使用 colnames 作为chart.Correlation 的标签,如 corrplot - How do i use colnames as labels for chart.Correlation like in corrplot 如何使用R中的charts.performanceanalytics绘制累积收益图表 - How to draw cumulative return chart with charts.performanceanalytics in R
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM