how do print labels next to a plot in R? -


i plotting 2 lines using

plot(x,y, type="l", color="red") 

and

points(x2,y2, type="l", color="blue") 

i want able add label next each line (instead of legend). pretty sure possible using package in http://directlabels.r-forge.r-project.org/.

yet, don't find easy way of doing that.

you can use locator() within text() point&click method.

y <- rnorm(100, 10) y2 <- rnorm(100, 20) x <- 1:100  plot(x, y, type = "n", ylim = c(0, 40), xlim = c(0, 120)) lines(x, y) lines(x, y2, col = "red") text(locator(), labels = c("red line", "black line)")) 

alt text


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -