2
votes

I am trying to plot a dot plot using library ggplot2. My script generates a dot plot for the sample data below, but I am required to have dot border colored but rest of the dot should be empty (no fill). For example if my dots are red, blue and green in color, I would just like to have the dot borders to be red, blue and green, while rest of the dot should be empty.

Following is my current script and sample data

library(ggplot2)      
File2=read.table("PB12_combo.txt", header=T, sep="\t")    
ggplot(File2, aes(x_axis, y_axis, colour=factor(z_axis)))+geom_point(size=5)

     x_axis  y_axis  z_axis
       605     250     2
       690     394     2
       762     109     2
       543     495     2
       388     538     2
       758     736     2
       197     409     2
       390     106     3
       390     343     4
1

1 Answers

6
votes

Change the shape for the points to 1

ggplot(File2, aes(x_axis, y_axis, colour=factor(z_axis)))+geom_point(size=5,shape=1)