Hello,
See if this is it. The standard trick is to reshape the data from wide
to long, see the SO post [1]. Then add a scale_shape_* layer to the plot.
yyy <- cbind(xxx, y3 = y3)
long <- reshape2::melt(yyy, id.vars = c("x", "y1", "grp"))
ggplot(long, aes(x, y = value, colour = variable, shap
Hi Rolf,
Some code to produce the plot you want is here:
https://gist.github.com/jeffreypullin/be752f11a136601ffecddc73ba0519b9
Hope you find it helpful.
Personally I have found that the key to effective ggplot2 use is getting
your data into the right format (one data.frame, tidy style) before
How about defining your dataset differently, making the colouring property a
variable?
xxx <- data.frame(x=rep(x, 4), y=c(y2, y3), grp=factor(rep(c("a","b"),each=20,
times=2)), type=factor(rep(c("clyde", "irving"), each=40)))
ggplot(xxx, aes(x,y, colour=type, shape=type)) + geom_point() +
geom_
Hello there,
I am using caret and neuralnet to train a neural network to predict times
table. I am using 'backprop' algorithm for neuralnet to experiment and
learn.
Before using caret, I've trained a neuralnet without using caret, I've
normalized my input & outputs using preProcess with 'range' m
Hello,
Here are two ways.
The first is an adaptation from your code. It uses facet_wrap_paginate,
not *_grid_*.
plotObj2 <- vector("list",2)
for(pg in 1:2) {
plotObj2[[pg]] <- ggplot(egDat) +
geom_point(aes(y = obsd, x = x),
na.rm = TRUE, shape = 20, colour = "blue") +
On 2/12/19 3:03 am, Rui Barradas wrote:
Hello,
See if this is it. The standard trick is to reshape the data from wide
to long, see the SO post [1]. Then add a scale_shape_* layer to the plot.
yyy <- cbind(xxx, y3 = y3)
long <- reshape2::melt(yyy, id.vars = c("x", "y1", "grp"))
ggplot(lon
On 2/12/19 10:45 am, Rui Barradas wrote:
Hello,
Here are two ways.
The first is an adaptation from your code. It uses facet_wrap_paginate,
not *_grid_*.
plotObj2 <- vector("list",2)
for(pg in 1:2) {
plotObj2[[pg]] <- ggplot(egDat) +
geom_point(aes(y = obsd, x = x),
On 2/12/19 5:08 pm, Rui Barradas wrote:
Hello,
Here are two ways of drawing the lines black and at the same time
removing the lines in the legend. The second way is more idiomatic.
1. Override the colour setting in the ggplot call when drawing the lines:
geom_line(aes(y = y1), colour = "bla
Hello,
Here are two ways of drawing the lines black and at the same time
removing the lines in the legend. The second way is more idiomatic.
1. Override the colour setting in the ggplot call when drawing the lines:
geom_line(aes(y = y1), colour = "black") +
2. Don't set the colour aestheti
9 matches
Mail list logo