您将需要在$ readarray -t array < <(echo "dGVzdA==" | base64 -d | xxd -p -c1)
$ declare -p array
declare -a array=([0]="74" [1]="65" [2]="73" [3]="74")
的美学调用中包括color参数,并设置geom_point()
。然后,您可以使用color = l
使用所需的颜色。
scale_color_manual
,
您还可以尝试使用数据框中的颜色从fill
中启用aes()
。在此代码中,我使用了不同的颜色,因为我对您以前拥有颜色的函数palette.colors
的了解不足。同样使用scale_fill_identity()
可以直接从数据变量(在fill
中定义的变量)获取颜色。这里的代码:
set.seed(1)
library(ggplot2)
library(ggrepel)
library(RColorBrewer)
df <- data.frame(n=runif(8),y=1:8,l=letters[1:8],col=rainbow(8))
#Plot
ggplot(df,aes(n,y,label = l,color=l,fill=col)) +
geom_point() +
geom_text_repel(show.legend = F)+theme_classic()+
scale_fill_identity()
输出:
本文链接:https://www.f2er.com/1516521.html