This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how can I draw a connecting line between the label and the plot in R

Hello everyone, This is my script for the plot,

> library(reader)

> data <- read.csv("C:\\Users\\user\\Documents\\kingdom.csv", header=TRUE, stringsAsFact=FALSE)
> dfdata = data.frame(data)

> dfdata

   Kingdom  Total

1 Bacteria 273523

2  Archaea   2613


> sizeRange <- c(0,30)

> library(ggplot2)
![enter image description here][1]
> ggplot(data, aes(x=0,y=Kingdom,color=Kingdom)) + geom_point(aes(size = Total,alpha=10),colour="blue",stroke=2) + scale_size(range = sizeRange)+ theme_bw() + theme(panel.border = element_blank(), panel.grid.major = element_blank(),panel.grid.minor = element_blank(), axis.line = element_line(colour = "white"))

somebody, please tell me how can I get a connecting line between my y-axis label and the plot

I want something like this

enter image description here

bubble ggplot2 r
ggplot(df, aes(x=0,y=Kingdom,color=Kingdom, label=Kingdom)) +
    geom_text_repel(nudge_x=-0.05, size=12, show.legend = F) +
    geom_point(aes(size = Total,alpha=10),colour="blue",stroke=2) +
    scale_size(range = sizeRange)+ 
    theme_bw() + 
    theme(panel.border = element_blank(), 
          panel.grid.major = element_blank(),
          panel.grid.minor = element_blank(), 
          axis.line = element_line(colour = "white"),
          axis.text=element_blank(),
          axis.ticks=element_blank(),
          axis.title.x = element_blank())

0 answers

No answers yet.

Log in to answer this question.