Hi All,

I want small modification in apperance of legend. I want seperate legend for each graph representing the lines present in that graph only (not all the lines in all graphs) .
Can you please help?

Thank you
Regards
Devarayalu

Orange1 <- structure(list(REFID = c(7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
8, 8, 8, 8, 9, 9, 9, 9), ARM = c(1, 1, 1, 1, 2, 2, 2, 2, 1, 1,
1, 1, 2, 2, 2, 2, 1, 1, 2, 2), SUBARM = c(0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), ACTTRT = structure(c(3L,
3L, 3L, 3L, 4L, 4L, 4L, 4L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L,
1L, 2L, 2L), .Label = c("ABC", "DEF", "LCD", "Vehicle"), class = "factor"),
    TIME1 = c(0, 2, 6, 12, 0, 2, 6, 12, 0, 2, 6, 12, 0, 2, 6,
    12, 0, 12, 0, 12), ENDPOINT = structure(c(1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L), .Label = "PGA", class = "factor"), BASCHGA = c(0, -39,
    -47, -31, 0, -34, -25, -12, 0, -45, -47, -20, 0, -25, -30,
    -35, 0, -30, 0, -40), STATANAL = structure(c(1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L), .Label = "UNK", class = "factor"), Art_Name = structure(c(1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
    2L, 2L, 2L, 2L), .Label = c("Bela_2010_206878", "Dansinger_2010_20687812"
    ), class = "factor")), .Names = c("REFID", "ARM", "SUBARM",
"ACTTRT", "TIME1", "ENDPOINT", "BASCHGA", "STATANAL", "Art_Name"
), row.names = c(NA, 20L), class = "data.frame")


unique(Orange1$REFID) -> refid
for (i in refid)
{
Orange2 <- Orange1[i == Orange1$REFID, ]
pdf(paste ("PGA", i, ".pdf", sep=''))
print(qplot(TIME1, BASCHGA, data=Orange2, geom= c("line"), colour= ACTTRT))
dev.off()
}


	[[alternative HTML version deleted]]

