泰勒图大小、颜色、保存参数?

问题描述 投票:0回答:1

我生成的泰勒图 使用库。

library(plotrix)
library(rJava)
library(xlsxjars)
library(readxl)
library(xlsx)

和使用的数据 dput(df)

structure(list(Pb = c(12.54, 12.53, 13.57, 19.22, 22.27, 18.37, 
19, 14.34, 16.35), Boruta_XGBoost = c(8.89136409759521, 8.85756206512451, 
8.21786308288574, 12.9624891281128, 13.2968854904175, 12.7977981567383, 
12.3957328796387, 9.69775390625, 11.781777381897), Boruta_SVM = c(12.8297886877439, 
14.1176611943491, 14.9879296831078, 18.1703565549757, 19.5840584003096, 
18.8792561701891, 16.2778795502105, 13.4901086669503, 14.2836465797069
), Boruta_RF = c(14.3177444444444, 11.1845266666667, 10.8805244444444, 
17.6771022222222, 20.7142466666667, 18.5657155555556, 16.8954355555556, 
12.9909844444444, 15.9368244444444), GA_XGBoost = c(8.90407180786133, 
8.7996244430542, 8.19470405578613, 12.927845954895, 13.1713933944702, 
12.896990776062, 12.4013185501099, 9.44187641143799, 11.9617586135864
), GA_SVM = c(14.5574045001675, 14.7111528658119, 14.5103784219767, 
17.6100336774524, 19.0957864342351, 17.836320761182, 15.7884998778531, 
13.2352198846198, 14.7596456378561), GA_RF = c(13.7602755555556, 
11.43164, 10.6581822222222, 18.0504933333333, 20.8309088888889, 
18.5738422222222, 16.5107822222222, 12.9161022222222, 15.53854
), XGBoost_XGBoost = c(8.42767715454102, 8.02925300598145, 7.27468395233154, 
12.2474374771118, 13.0366401672363, 13.088475227356, 12.264874458313, 
8.62850284576416, 10.4450559616089), XGBoost_SVM = c(13.0668720920662, 
11.9439605396003, 12.2892781235256, 18.9685052474489, 22.1775370825045, 
18.5729878124879, 18.412140924591, 13.7120185862238, 15.2216196143028
), XGBoost_RF = c(12.5330444444444, 12.6012, 10.6674022222222, 
17.7389044444445, 20.4518844444445, 18.4774088888889, 17.0711288888889, 
12.8564933333333, 14.4656444444444)), row.names = c(NA, -9L), class = c("tbl_df", 
"tbl", "data.frame"))

使用以下代码。

taylor.diagram(Actual,
               Boruta_XGBoost,
               add=FALSE,
               col="#FFFF33", #the color for the points displayed.
               pch=19, #the type of point to display.
               #For Color: ("#FFFFFF" = White, “#990000” = Red) see more:- http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/

               pos.cor=TRUE,
               xlab="Standard deviation (Normalized)", 
               ylab="Standard deviation (Normalized)", 
               main="Taylor Diagram of all applied models Vs Actual",

               show.gamma=TRUE, #whether to display standard deviation arcs around the reference point (only for pos.cor=TRUE).
               ngamma=4, #the number of gammas to display (default=3).
               gamma.col = "red", #color to use for the gamma arcs (only with pos.cor=TRUE).

               sd.arcs=3, #whether to display arcs along the standard deviation axes.
               ref.sd=TRUE, #whether to display the arc representing the reference standard deviation.
               sd.method=TRUE, #Whether to use the sample or estimated population SD.
               grad.corr.lines = c(0.2,0.4,0.6,0.8,0.9), #the values for the radial lines for correlation values

               pcex=2.8, cex.axis=1.8, cex.lab=2.2, #pcex for size of 'pch'; cex.axis for size of tick; 
               normalize=TRUE, #whether to normalize the models so that the reference has a standard deviation of 1.
               mar=c(5,6,5,10), #margin=( bottom, left, top, right); only apply for pos.cor = TRUE plot

               lwd=10,
               font=6,
               lty=1)

我的采石场是:

  1. 为什么x-axis-label的大小没有增加? cex.sub 的说法也是如此。
  2. 如何增加 gamma 和 sd.arc 线的大小?
  3. 如何改变sd.arc线的颜色?
  4. 如何将此图保存在一个可编辑的文件中;但是,我用了 library(officer) 无功而返
  5. 如果有的话,请分享一下。
  6. 任何一个问题的单一答案也会感激不尽.非常感谢!
r ggplot2 save size taylor-series
1个回答
1
投票

这是一个部分答案。按题中的采石场编号回答。

  1. 你的代码 cex.lab=2.2 是工作。我把它改成了 cex.lab=1 并得到了非常明显的差异。同理,其他 cex 2 - 3. 这些不是函数中的选项。

2 - 3.这些都不是函数中的选项。然而,你可以做的是从这里复制该函数的代码。https:/github.combotrixplotrixblobmasterRtaylor.diagram.R。 并修改你想要的东西,保存为你自己的函数。例如,在注释为 "#添加轴 "的部分,将颜色选项改为 col = "red" 或什么的。

  1. 我不知道你说的可编辑情节是什么意思。也许有人能解决。

  2. 搜索 https:/ggplot2.tidyverse.orgreferenceindex.html。 结果没有任何与 "泰勒 "相匹配的东西,所以我不这么认为。

© www.soinside.com 2019 - 2024. All rights reserved.