godwin
unread,Mar 2, 2012, 1:09:17 AM3/2/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggplot2
Hi all,
I have the following data.frame:
n model beta power
1 50 1 1 0.6294
2 50 2 1 0.6293
3 50 3 1 0.5061
4 75 1 1 0.8022
5 75 2 1 0.7873
6 75 3 1 0.6796
7 100 1 1 0.9020
8 100 2 1 0.8878
9 100 3 1 0.8029
19 50 1 2 0.3128
20 50 2 2 0.1054
21 50 3 2 0.2035
22 75 1 2 0.4208
23 75 2 2 0.1275
24 75 3 2 0.2705
I wish to plot n vs model, color according to model, and set linetype
to beta. I've managed to do so with the following code, but am having
trouble changing the linetype in the legend. Any ideas?
qplot(n, power, col=factor(4*model+beta), lty=beta, data=result,
geom="line") + theme_bw() + scale_colour_manual(values=c("#999999",
"#999999", "#E69F00", "#E69F00", "#56B4E9", "#56B4E9"), name="Legend",
breaks=c(5,6,9,10,13,14), labels=c("m1,b1", "m1,b2", "m2,b1", "m2,b2",
"m3,b1", "m3,b2"))
Best,
Godwin