Re: [R] How to shade area between lines in ggplot2

2020-10-27 Thread Luigi Marongiu
1*x + intercept_1 + 1/w[2]), fill = "yellow", alpha=0.1) > > Cheers > Petr > > > -Original Message- > > From: Luigi Marongiu > > Sent: Friday, October 23, 2020 3:30 PM > > To: PIKAL Petr > > Cc: r-help > > Subject: Re: [R] How to shade area b

Re: [R] How to shade area between lines in ggplot2

2020-10-25 Thread PIKAL Petr
Friday, October 23, 2020 3:30 PM > To: PIKAL Petr > Cc: r-help > Subject: Re: [R] How to shade area between lines in ggplot2 > > Thank you, but this split the area into two and distorts the shape of the > plot. > (compared to ``` p + geom_abline(slope = slope_1, intercept

Re: [R] How to shade area between lines in ggplot2

2020-10-23 Thread Rui Barradas
Hello, What about this? straightline <- function(x, slope, intercept) slope*x + intercept p <- ggplot(data = trainset, aes(x=x, y=y, color=z)) + geom_point() + geom_ribbon(aes(ymin = straightline(x, slope_1, intercept_1 + 1/w[2]), ymax = straightline(x, slope_1, intercept

Re: [R] How to shade area between lines in ggplot2

2020-10-23 Thread Luigi Marongiu
min = slope_1*x + intercept_1 - 1/w[2], > ymax = slope_1*x + intercept_1 + 1/w[2], fill = "grey70", alpha=0.1)) > > Cheers > Petr > > > -Original Message- > > From: Luigi Marongiu > > Sent: Friday, October 23, 2020 11:11 AM > > To: PIKAL P

Re: [R] How to shade area between lines in ggplot2

2020-10-23 Thread PIKAL Petr
o: PIKAL Petr > Cc: r-help > Subject: Re: [R] How to shade area between lines in ggplot2 > > also from this site: https://plotly.com/ggplot2/geom_ribbon/ > I get the answer is geom_ribbon but I am still missing something ``` #! plot > p > = ggplot(data = trainse

Re: [R] How to shade area between lines in ggplot2

2020-10-23 Thread Luigi Marongiu
n-lines-using-g > gplot-in-r > > Cheers > Petr > > > -Original Message- > > From: R-help On Behalf Of Luigi Marongiu > > Sent: Friday, October 23, 2020 9:59 AM > > To: r-help > > Subject: [R] How to shade area between lines in ggplot2 > > >

Re: [R] How to shade area between lines in ggplot2

2020-10-23 Thread Luigi Marongiu
inal Message- > > From: R-help On Behalf Of Luigi Marongiu > > Sent: Friday, October 23, 2020 9:59 AM > > To: r-help > > Subject: [R] How to shade area between lines in ggplot2 > > > > Hello, > > I am running SVM and showing the results with ggplot2.

Re: [R] How to shade area between lines in ggplot2

2020-10-23 Thread Luigi Marongiu
n-lines-using-g > gplot-in-r > > Cheers > Petr > > > -Original Message- > > From: R-help On Behalf Of Luigi Marongiu > > Sent: Friday, October 23, 2020 9:59 AM > > To: r-help > > Subject: [R] How to shade area between lines in ggplot2 > >

Re: [R] How to shade area between lines in ggplot2

2020-10-23 Thread PIKAL Petr
M > To: r-help > Subject: [R] How to shade area between lines in ggplot2 > > Hello, > I am running SVM and showing the results with ggplot2. The results include > the decision boundaries, which are two dashed lines parallel to a solid line. I > would like to remove the dash

[R] How to shade area between lines in ggplot2

2020-10-23 Thread Luigi Marongiu
Hello, I am running SVM and showing the results with ggplot2. The results include the decision boundaries, which are two dashed lines parallel to a solid line. I would like to remove the dashed lines and use a shaded area instead. How can I do that? Here is the code I wrote.. ``` library(e1071) lib