1
I’m charting some data on a Bubble Chart using the package ggplot2
of R.
My data is out of order on the Y axis. I would like you to follow the order of the numbers present in the names, for example: CenpSat1A
, CenpSat2A
, CenaSat15Y
, but I’m not getting it when I just sort the data.
Below the code I used to generate the attached image chart:
library(ggplot2)
ggplot(dados, aes(x = Espécies, y = DNAsat, size = Reads,
fill=Espécies)) + geom_point(shape = 21) + theme_bw() +
scale_fill_brewer(palette="Pastel1") + scale_size_area(max_size=13)
dput
to assist the response:
structure(list(DNAsat = structure(c(9L, 4L, 10L, 5L, 11L, 12L,
13L, 14L, 15L, 6L, 1L, 2L, 7L, 8L, 3L, 9L, 4L, 10L, 5L, 11L,
12L, 13L, 14L, 15L, 6L, 1L, 2L, 7L, 8L, 3L), .Label = c("CenaSat11B",
"CenaSat12Y", "CenaSat15Y", "CenaSat2A", "CenaSat4A", "CenpSat10B",
"CenpSat13Z", "CenpSat14Y", "CenpSat1A", "CenpSat3A", "CenpSat5Y",
"CenpSat6A", "CenpSat7Y", "CenpSat8Z", "CenpSat9Y"), class = "factor"),
Espécies = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Cenchrus americanus",
"Cenchrus purpureus"), class = "factor"), Reads = c(35629,
32123, 33698, 31857, 31812, 30664, 7534, 7128, 6395, 1887,
1865, 1435, 1069, 272, 18, 28201, 26867, 27799, 26206, 25967,
25987, 0, 11419, 0, 11879, 11887, 336, 0, 0, 220)), class = "data.frame", row.names = c(NA,
-30L))
Welcome to Stackoverflow! Unfortunately, this question cannot be reproduced by anyone trying to answer it. Please take a look at this link (mainly in the use of function
dput
) and see how to ask a reproducible question in R. So, people who wish to help you will be able to do this in the best possible way.– Marcus Nunes
Hi, thanks for the tips. I entered the dput result.
– Alex Silvestrini