Hi,
You can use the directlabels package for this:
car <- read.csv("demo.csv")
library(ggplot2)
#install.packages("directlabels")
library(directlabels)
car$Var <- abbreviate(car$variable)
p <- ggplot(data=car,
aes(x=X.10.130, y=value, colour=Var)) +
geom_line()
direct.label(p+xlim(min(car$X.10.130), max(car$X.10.130)+30))
Best,
Ista
On Fri, Jul 6, 2012 at 10:49 AM, UTS <
isaa...@gmail.com> wrote:
> Dear R peoples,
>
> I have generated the following graph:
>
> [IMG]
http://i47.tinypic.com/s3dd0m.png[/IMG]
>
> I have long data THAT IS ATTACHED TO THIS POST, however it looks like:
>
> head(data)
> -10:130 variable value
> 1 -10 Utilities 0.001680609
> 2 -9 Utilities 0.004652453
> 3 -8 Utilities -0.002441692
> 4 -7 Utilities -0.018639594
> 5 -6 Utilities -0.007587632
> 6 -5 Utilities 0.004526066
>
> The code I used to generate this graphic:
>
> ggplot(data=car,
> aes(x=-10:130, y=value, colour=variable)) +
> geom_line()
>
> I want something that looks like the following graphic:
>
> [IMG]
http://i46.tinypic.com/2cmvfrq.png[/IMG]
>
> with the legend gone, but the acronym of the category displayed right at the
> end of each line in the same colour.
>
>
> I've tried numerous things but have gotten nowhere, and would appreciate
> some assistance.
>
> Thank you :)
>
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
>
https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email
ggp...@googlegroups.com
> To unsubscribe: email
ggplot2+u...@googlegroups.com
> More options:
http://groups.google.com/group/ggplot2