惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
V
V2EX
博客园_首页
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
H
Help Net Security
A
About on SuperTechFans
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
云风的 BLOG
云风的 BLOG
D
Docker
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
N
News and Events Feed by Topic
Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
A
Arctic Wolf
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
博客园 - 三生石上(FineUI控件)
aimingoo的专栏
aimingoo的专栏
Hacker News: Ask HN
Hacker News: Ask HN
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy International News Feed
T
Troy Hunt's Blog
T
Tenable Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Recorded Future
Recorded Future
F
Fortinet All Blogs
D
DataBreaches.Net
B
Blog
T
Threat Research - Cisco Blogs
MyScale Blog
MyScale Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
The GitHub Blog
The GitHub Blog
Security Latest
Security Latest
M
MIT News - Artificial intelligence

Home on Jinji

日本 死亡与迷茫 - Jinji About - Jinji 自我认识 - Jinji 博士屯和大农村 - Jinji Robot Dreams - Jinji 黄粱五载梦 - Jinji The Practice of Management - Jinji My shortcomings - Jinji Replying reviewers' comments - Jinji Curriculum Vitae - Jinji 加州旅馆 - Jinji Protocol for correlation analysis of microbiome and metabolome using 16S rRNA sequencing and untargeted metabolomics - Jinji 少有人走的路 - Jinji 抑郁情绪与抑郁症 - Jinji Spiral Plating and Automatic Colonies Counting - Jinji 回答2022 - Jinji 母亲 - Jinji 北下关 - Jinji 上瘾 - Jinji 师姐 - Jinji MALDI-tof - Jinji 西游记 - Jinji 追求卓越(完美)一定对吗? - Jinji DC开会 - Jinji How to write a publishable manuscript - Jinji 曲-《感谢你的荫庇》 - Jinji 今年的final比以往结束得早一些 - Jinji 世上有没有无缘无故的恨? - Jinji Endless Pain Comes from Ignorance - Jinji 六子吃了几碗粉? - Jinji Martial Arts Curriculum Vitae - Jinji 保存文件 - Jinji 回答2021 - Jinji 十二年 - Jinji 一个人的考试 - Jinji 三多成才 - Jinji !高等教育,==自学 - Jinji 由奢入俭难 - Jinji 乐-《世家》 - Jinji 此时此刻 - Jinji 已往之不谏 - Jinji 谁的锅 - Jinji 嫉与妒 - Jinji 那些年我没能理解的语文课文 - Jinji A Question During Judo Testing and Some Thoughts - Jinji 砚台 - Jinji 音- 梁博《我不知道》 - Jinji 论拖延 - Jinji 一天 - Jinji 菜谱 - Jinji 世界上存在跟你同名同姓的人吗? - Jinji 游-向死而生,寻梦环游墨西哥 - Jinji 昨日 - Jinji 无忘当时 - Jinji 时光易逝,年华易老 - Jinji 简历 - Jinji
R Language Notes - Jinji
2021-07-28 · via Home on Jinji

Jinji / 2021-07-28


Disclaimer

To save my time finding codes(since I can’t remember all of them), I made some notes here. These codes were all from online resources and I might have made some adjustments or might not. Copyright belongs to the original author, please inform site owner if any infringement.

C

Color

  • add more colors to a color palette
library(RColorBrewer)
# Define the number of colors you want
nb.cols <- 13
mycolors <- colorRampPalette(brewer.pal(12, "Set3"))(nb.cols)
# Set3 has 12 colors
# Create a ggplot with 13 colors 
# Use scale_fill_manual
plot<-ggplot(df, aes(x = x var, y = y var, fill = some factor)) + 
  geom_bar(stat = "identity")+ylab("YY")+
  theme(axis.text.x = element_text(angle = 90))+
  theme(axis.title.x = element_blank())+
  scale_fill_manual(values =mycolors)

L

Legend

  • change legend size
ggplot(df, aes(x=x var, y=y var)) +
  theme(legend.key.size = unit(1, 'cm'), #change legend key size
        legend.key.height = unit(1, 'cm'), #change legend key height
        legend.key.width = unit(1, 'cm'), #change legend key width
        legend.title = element_text(size=14), #change legend title font size
        legend.text = element_text(size=10)) #change legend text font size