I have a table with coordinate data that looks like this,
V1 V2 V3 V4
10253363 10273825 9982154 10003803
10265080 10285697 9993266 10015040
10250800 10271301 9979709 10001394
10254775 10275140 9983264 10004815
10268607 10288871 9995004 10016450
10263978 10284276 9992831 10014300
And I'd like to generate a plot similar to the one shown below,
I tried this,
blast <- fread("../plots/coords.tsv")
blast$id = as.numeric(rownames(blast))
ggplot(blast)+
geom_rect(aes(xmin=V1,xmax=V2,ymin=V3,ymax=V4, group = id), alpha=0.2) +
scale_y_continuous(position = "top")
and ended up with the plot below instead.
It seems like y axis position could only be flipped between right and left. Therefore, this isn't working for me.
How do I generate the intended plot in ggplot2
? Or is there another way to get at that?