The whole new series. In the current series, #RActual Combat is mainly based on bio-information analysis , #Follow CNSLearn to draw mainly to reproduce the top journals Figure
, and this series #Rdrawing is to learn the pictures that are not in the article but also good-looking, dedicated to To provide students with new ideas and methods in data visualization.
Opening picture
Sample data and code pickup
点赞
, 在看
this article, share it in the circle of friends , 集赞20个
and 保留30分钟
send the screenshot to WeChat to mzbj0002
receive it.
Canoe Notes 2022 VIP can be obtained for free .
Canoe Notes 2022 VIP Project
rights and interests:
2022 Canoe Notes **All tweet sample data and codes (updated in real time in the VIP group)**.
Canoe Notes Scientific Research Exchange Group .
Half-price purchase
跟着Cell学作图系列合集
(free tutorial + code collection)|Follow Cell to learn to draw a collection of series .
TOLL:
99¥/person . You can add WeChat: mzbj0002
transfer money, or give a reward directly at the end of the article.
draw
rm(list = ls())
library(ggpubr)
library(ggprism)
library(paletteer)
plot_df = read.csv('plot_df.csv')
## 设置主题
rel_size <- 1
my_theme <- theme_prism(border = TRUE,
base_size = 5) +
theme(strip.text.x = element_text(size = rel(rel_size*2)),
title = element_text(size = rel(rel_size*2)),
legend.box.spacing = unit(1, "cm"),
legend.text = element_text(size = rel(rel_size*1.5)),
legend.title = element_text(size = rel(rel_size*0.5)),
axis.text.y = element_text(size = rel(rel_size*2), angle = 0, vjust = 0.2),
axis.text.x = element_text(size = rel(rel_size*1.6), angle = 45),
panel.grid = element_line(color = "gray",
size = 0.15,
linetype = 2),
panel.spacing = unit(1, "lines"),
plot.caption = element_text(size = rel_size*8))
# 绘图
p <- ggplot(plot_df, aes(x = log10(mean_gdp_per_capita), y = mean_access_perc)) +
# coord_trans("log10") +
geom_point(data = plot_df, aes(size = mean_death_perc, fill = continent), pch = 21) +
geom_smooth(method = "loess") +
scale_fill_paletteer_d("colorblindr::OkabeIto") +
ggpubr::stat_cor(method = "spearman",
aes(label = paste(..rr.label.., ..p.label.., sep = "~")),
color = "red", geom = "label", label.x = 3.8, label.y = 5) +
# facet_wrap(vars(continent),drop = TRUE) +
scale_y_continuous(breaks = c(0, 25, 50, 75, 100)) +
my_theme +
ggtitle("Access to clean energy is associated with GDP") +
labs(x = "Log10 of Average GDP per capita",
y = "Average % access to clean fuels/tech",
fill = "Continent",
size = "Average % Death",
caption = "Spearman correlation\nAveraged values over years 1990-2019\nData source: OurWorldInData.org")
p
ggsave(plot = p, filename = 'week1.pdf',width = 5,height = 4)
reference
https://github.com/nicholas-camarda/tidytuesda
Past content
(Free Tutorial + Code Collection)|Follow Cell to Learn Drawing Series Collection
Front Immunol reproduction | 1. GEO data download and sva batch correction (PCA visualization)