I’m trying to label the points of an ECDF plot with another column from my data field.
Currently I’m using this:
untouched = read.table("results-untouched.tsv", sep="\t")
plot.ecdf(untouched$V4, xlim=c(0.75,1.25), ylim=c(0,1), col='green', verticals=T)
which plots allright, but I’m then unable to add the labels to the points. The labels would be in untouched$V1.
Any idea on how to do this?
To add labels, you can use the
textfunction. For example, we generate some datathen create the ecdf object (
plot.ecdfdoes this automatically),and plot
mTo add labels, we use the
textfunction. The x coordinates are the data, the y coordinates are the output from theecdffunction (with an additional 0.03 to avoid over-plotting):