Getting R plot type “b”

is there a way in ggplot2 to get the plot type "b"? See example:

x <- c(1:5)
y <- x 
plot(x,y,type="b")

Ideally, I want to replace the points by their values to have something similar to this famous example:

alt text

EDIT: Here some sample data (I want to plot each "cat" in a facet with plot type "b"):

df <- data.frame(x=rep(1:5,9),y=c(0.02,0.04,0.07,0.09,0.11,0.13,0.16,0.18,0.2,0.22,0.24,0.27,0.29,0.31,0.33,0.36,0.38,0.4,0.42,0.44,0.47,0.49,0.51,0.53,0.56,0.58,0.6,0.62,0.64,0.67,0.69,0.71,0.73,0.76,0.78,0.8,0.82,0.84,0.87,0.89,0.91,0.93,0.96,0.98,1),cat=rep(paste("a",1:9,sep=""),each=5))

Regards, Musa

5
задан Tjebo 6 May 2019 в 22:12
поделиться