Displaying 20 results from an estimated 31 matches for "geom_ribbon".
2010 May 30
2
geom_ribbon removes missing values
Hi everyone,
it looks like geom_ribbon removes missing values and plots a single
ribbon over the whole interval of x values. However, I'd rather want it
to act like geom_line, that is, interrupt the ribbon for the interval of
missing values and continue once there are new values. Here's an example:
library(ggplot2)
df <- dat...
2008 Feb 17
1
ggplot2: bug in geom_ribbon + log scale!?
Hi everyone, Hadley,
it seems there's a bug in geom_ribbon() when using it in a log-scaled plot:
d<-data.frame(x=c(1:20),y1=rnorm(20)+3,y2=rnorm(20)+5)
p<-ggplot()
p<-p+geom_ribbon(data=d,aes(x=d[["x"]],min=d[["y1"]],max=d[["y2"]]))
p<-p+geom_line(data=d,aes(x=d[["x"]],y=d[["y1"]]),colour="...
2020 Oct 23
2
How to shade area between lines in ggplot2
...linetype = "dashed", col = "royalblue")
```
Why there is a hole in the middle of the ribbon? and the color is not grey...
On Fri, Oct 23, 2020 at 2:35 PM PIKAL Petr <petr.pikal at precheza.cz> wrote:
>
> Hi
>
> What about something like
>
> p+geom_ribbon(aes(ymin = 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 <marongiu.luigi at gmail.com>
> > Sent: Friday, October 2...
2020 Oct 26
0
How to shade area between lines in ggplot2
Hi
Put fill outside aes
p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2],
ymax = slope_1*x + intercept_1 + 1/w[2]), fill = "blue", alpha=0.1)
The "hole" is because you have two levels of data (red and blue). To get rid
of this you should put new data in ribbon call.
Something like
newdat <- trainset
n...
2020 Oct 23
2
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 = trainset, aes(x=x, y=y, color=z)) +
geom_point() + scale_color_manual(values = c("red", "blue"))
# show support vectors
df_sv = trainset[svm_model$index, ]
p = p + geom_point(data =...
2020 Oct 23
0
How to shade area between lines in ggplot2
Hi
What about something like
p+geom_ribbon(aes(ymin = 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 <marongiu.luigi at gmail.com>
> Sent: Friday, October 23, 2020 11:11 AM
> To: PIKAL Petr &...
2023 Aug 12
2
geom_smooth
...ary(ggplot2)
library(cowplot)
ggplot(scatter_data,aes(x=x_var,y=y_var))+
? geom_point()+
? geom_smooth(se=TRUE,fill="blue",color="black",linetype="dashed")+
? theme_cowplot()
I'd like to add a black boundary around the shaded area. I suspect this can be done with geom_ribbon but I cannot figure this out. Some advice would be welcome.
Thanks!
Thomas Subia
2023 Aug 12
1
geom_smooth
...0000 (UTC)
Thomas Subia via R-help <r-help at r-project.org> wrote:
> Here is my reproducible code for a graph using geom_smooth
The call "library(tidyverse)" was missing. :)
> I'd like to add a black boundary around the shaded area. I suspect
> this can be done with geom_ribbon but I cannot figure this out. Some
> advice would be welcome.
This works for me:
ggplot(scatter_data,aes(x=x_var,y=y_var,))+
geom_point()+
geom_smooth(se=TRUE,fill="blue",color="black",linetype="dashed") +
geom_ribbon(stat="smooth", aes(ymin=after_...
2007 Sep 03
1
Legend issue with ggplot2
...ll"
not found).
library(ggplot2)
dummy <- data.frame(x = rep(1:10, 4), group = gl(4, 10))
dummy$y <- dummy$x * rnorm(4)[dummy$group] + 5 * rnorm(4)[dummy$group]
dummy$min <- dummy$y - 5
dummy$max <- dummy$y + 5
ggplot(data = dummy, aes(x = x, max = max, min = min, fill = group)) +
geom_ribbon() + geom_line(aes(y = max, colour = fill)) + geom_line(aes(y
= min, colour = fill))
When I adjust the code to the line below, it works again. But this time
with two legend keys for "group". Any idea how to display only one
legend key for group? The ggplot-code aboved yielded only on lege...
2010 Sep 16
1
plotting time series using ggplots
.... So, something like this:
rwl<-matrix(rnorm(800), nrow = 100)
colnames(rwl) <- paste('V', 1:8, sep = '')
rownames(rwl)<-c(1900:1999)
rwl<-as.data.frame(rwl))
I have 2 specific things I'd like to do:
1) use stat_summary(), geom_line(), and either geom_smooth() or
geom_ribbon() to plot the mean of the timeseries (e.g. V1:V8) and
error bands or confidence limits around the mean for each year. I
cannot figure out how to do this except for this really clunky way:
rwl$year<-as.numeric(rownames(rwl))
h<-ggplot(rwl, aes(x=year))
h+ geom_line(aes(y=V1)) #plots one...
2023 Aug 12
1
geom_smooth
...t; ggplot(scatter_data,aes(x=x_var,y=y_var))+
> ? geom_point()+
> ? geom_smooth(se=TRUE,fill="blue",color="black",linetype="dashed")+
> ? theme_cowplot()
>
> I'd like to add a black boundary around the shaded area. I suspect this can be done with geom_ribbon but I cannot figure this out. Some advice would be welcome.
>
> Thanks!
>
> Thomas Subia
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do...
2011 Jun 02
2
shading in overlap between two ranges
I have 2 datafiles 'target' and 'observed' as shown below (I will gladly
email these 2 small files to whomever). X25. And X75. Indicate the
value of 25th and 75th-percentile of the target ('what should be') and
the observed ('what is'). The i.value is simply the month.
> target
X i.value X25. X75.
1 one.month 1 10.845225 17.87237
2
2020 Oct 23
0
How to shade area between lines in ggplot2
Hi
Did you try google? I got several answers using your question
e.g.
https://stackoverflow.com/questions/54687321/fill-area-between-lines-using-g
gplot-in-r
Cheers
Petr
> -----Original Message-----
> From: R-help <r-help-bounces at r-project.org> On Behalf Of Luigi Marongiu
> Sent: Friday, October 23, 2020 9:59 AM
> To: r-help <r-help at r-project.org>
> Subject:
2020 Oct 23
5
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 dashed lines and use a
shaded area instead. How can I do that?
Here is the code I wrote..
```
library(e1071)
library(ggplot2)
set.seed(100)
x1 = rnorm(100, mean = 0.2, sd = 0.1)
y1 = rnorm(100, mean = 0.7, sd =
2010 Oct 19
2
superpose.polygon, panel.polygon and their colors
Dear R-helpers,
the problem I'm facing today is to convince lattice to paint some areas
in gray.
The areas I would like to have in gray, are confidence bands
I've googled around in the mailing list archives and eventually find
some clues.
This link is my starting point
http://tolstoy.newcastle.edu.au/R/e2/help/07/04/15595.html
I'm reproducing here the code for your convenience
est
2011 May 27
2
help with barplot
Hi,
I'm really struggling with barplot
I have a data.frame with 3 columns. The first column represents an
"incident" type
The second column represents a "month"
The third column represents a "time"
Code for a sample data.frame
incidents <- rep(c('a','b','d','e'), each =25)
months <- rep(c(1,2), each =10)
times
2009 Apr 23
1
ggplot2/aesthetic plotting advice
Consider the following situation:
we have quantified algal concentrations for
a variety of species using many samples at each
of three years. It seems to make sense to generate
a line plot (matplot-like), with each species plotted
as a separate line, with the points connected to emphasize
the temporal pattern.
The problem: lots of overlapping error bars.
The question: from both a
2020 Sep 30
4
Graficar una curva de tendencia potencial.
AF_E PS_E
90.838 2.206
83.139 1.751
134.272 3.710
84.043 2.076
105.184 2.788
157.249 3.783
50.280 1.027
96.973 2.355
123.582 3.398
60.417 1.236
123.501 3.315
90.128 1.566
193.783 5.167
116.036 2.994
100.289 2.216
56.943 1.106
102.272 2.692
145.579 3.810
53.105 1.202
127.212 3.061
102.838 2.383
126.352 2.723
13.661 0.190
164.352 4.870
159.945 4.160
54.382 0.884
128.253 3.598
181.208 4.767
145.118
2007 Jun 19
0
ggplot2 0.5.2
...his)
* can now pass position objects to qplot
* y jitter calculated correctly, and jittered data rescales axis now
* removed silly legend from quantile plot
* extra arguments not being passed on to geoms/stats
* fixed bug in stat_summary when summarising a factor
* fixed bugs in stat_summary, geom_ribbon, and coord_trans examples
_______________________________________________
R-packages mailing list
R-packages at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-packages
2007 Jun 19
0
ggplot2 0.5.2
...his)
* can now pass position objects to qplot
* y jitter calculated correctly, and jittered data rescales axis now
* removed silly legend from quantile plot
* extra arguments not being passed on to geoms/stats
* fixed bug in stat_summary when summarising a factor
* fixed bugs in stat_summary, geom_ribbon, and coord_trans examples
_______________________________________________
R-packages mailing list
R-packages at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-packages