Thanks Hadley for your input.
The following code works fine now.
Thanks again
con = textConnection("inputs var1 var2 var3
100 10 5 2
1000 20 10 4
5000 30 15 8
1 40 20 16
3 50 25 32")
data = read.table(con, header=TRUE)
data
data = melt(data, id="inputs")
g <- ggplot(data,aes(x=inpu
On Mon, Jan 16, 2012 at 6:05 PM, Mary Kindall wrote:
> Thanks for reply
> I wanted to have legend name with spaces. Right now I am using the
> following code but it produce two legends. I have to use Gimp to cut the
> redundant legend.
Your basic problem is that you're using the fill and colour
a
Just jumping into the thread it looks like your penultimate and antepenultimate
lines of code both add a legend - perhaps cut one?
Michael
On Jan 16, 2012, at 7:05 PM, Mary Kindall wrote:
> Thanks for reply
> I wanted to have legend name with spaces. Right now I am using the
> following code b
Thanks for reply
I wanted to have legend name with spaces. Right now I am using the
following code but it produce two legends. I have to use Gimp to cut the
redundant legend.
--
con = textConnection("inputs var1 var2 var3
100 10 5 2
1000 20 10 4
5000 30 15 8
1 40 20 16
3 50 25 32
Mary:
Here's one way.
## change the variable name to whatever title you want on your legend
data = melt(data, id="inputs",variable_name="customName")
data
g <- ggplot(data,aes(x=inputs, value, colour= customName, fill = customName,
shape=customName))
g <- g + geom_line(lwd=0.8)
g <- g + geom_point(
5 matches
Mail list logo