I'm trying to change the color of my data in a Scatter Plot.
I have 5 columns (only 3 with values for my Plot) with 264.000 rows, this my dataframe:
ID1 ID2 dN dS t
QJY77946 NP_073551 0.0241 0.1402 0.1479
QJY77954 NP_073551 0.0119 0.0912 0.0870
QJY77954 QJY77946 0.0119 0.0439 0.0566
My Scatter Plot when I make Column dN vs dS is this:
enter image description here
My question: How I can change the color for points in each column (one color for column dN, other for the column dS...)??
I′m using ggplot2 and tidyverse libraries in RStudio, this is my code for Scatter Plot:
Any idea or help is welcome!
Thank!
ggplot(aes(x = dN, y = t)) +
geom_point(size = 0.2) +
labs(title = "Pairwise Comparison S Protein",
subtitle = "dS vs dN with YN00",
x = "dS rate",
y = "dN rate") +
theme_bw() +
theme(axis.title = element_text())```
question from:
https://stackoverflow.com/questions/65890252/how-can-i-change-the-point-color-in-my-scatter-plot-for-each-column-of-my-datafr 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…