Displaying 20 results from an estimated 5000 matches similar to: "Newbie: Drawing fitted lines on subset of data"
2023 May 16
0
Newbie: Drawing fitted lines on subset of data
Yep, that did it. I didn't know that you could have pipelines within
pipelines.
Thanks, again, for all your help.
-Kevin
On 5/16/23 11:44, Rui Barradas wrote:
> ?s 15:29 de 16/05/2023, Kevin Zembower via R-help escreveu:
>> Hello,
>>
>> I's still working with my tsibble of weight data for the last 20 years.
>> In addition to drawing an overall trend line,
2011 Jun 26
1
changing graphs in qqplot2
This is what I have now so far.
p=ggplot(data = test, aes(x = YEAR, y = TOTAL, colour = TREATMENT)) +
geom_point() + geom_smooth(method = "lm", se=FALSE) + facet_wrap(~COUNTRY)
> p +scale_x_continuous(limits=c(1,4))
http://r.789695.n4.nabble.com/file/n3626510/graph.gif
I would also like to:
1.) change the headline for the faced wraps ?high? and ?low?. Is there any
other way of
2023 May 12
2
Newbie: Controlling legends in graphs
Hello, I'm trying to create a line graph with a legend, but have no
success controlling the legend. Since nothing I've tried seems to work,
I must be doing something systematically wrong. Can anyone point this
out to me?
Here's my data:
> weights
# A tibble: 1,246 ? 3
Date J K
<date> <dbl> <dbl>
1 2000-02-13 133 188
2
2007 Jul 24
1
ggplot2 axis color
Hi:
Does anyone have an idea on how to color the axis and
labels using ggplot2? This is what I got:
library(ggplot2)
p <- qplot(total_bill, tip, data = tips)
NewPlot<- p + geom_abline(slope=c(0.1,0.15,0.2),
colour=c("red","blue","yellow"),size=c(2,5,2))
NewPlot + geom_smooth(colour="green",
size=3,linetype=3)
2020 Oct 23
2
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 = intercept_1 - 1/w[2],
linetype = "dashed", col = "royalblue") +
geom_abline(slope = slope_1, intercept = intercept_1 + 1/w[2],
linetype = "dashed", col = "royalblue")
```
Why there
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 = df_sv, aes(x=x, y=y),
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 <petr.pikal at precheza.cz>
> Cc: r-help
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
newdat$z <- factor(0)
p+geom_ribbon(data=newdat, aes(ymin =
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 =
2007 Nov 08
1
ggplot2 geom_abline slope not working?
I am learning ggplot2, and need your help.
When I try
> p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point()
> p + geom_abline(slope=5)
(from http://had.co.nz/ggplot2/geom_abline.html)
the slope of the abline does not change, but this works:
> p + geom_abline(intercept=20)
In order to have slope work, I have to use
> p + geom_abline(aes(slope=5))
Is it a bug, or is there
2007 Oct 03
1
ggplot2: problem with geom_errorbar and geom_abline
Hi all,
I have run into what appears to be a bug in ggplot2; however, I am new
to the ggplot syntax, so I might be missing a key element. The main
issue is that I cannot get geom_abline to plot when colour is used to
identify "group" in the main plot. When I remove colour, geom_abline
works but the error bars have an undesirable line drawn between the left
edges of the caps. Does
2008 Apr 04
0
ggplot2 - version 0.6
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2008 Apr 04
0
ggplot2 - version 0.6
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2011 Jul 10
2
grey colored lines and overwriting labels i qqplot2
I created this graph in ggplot and added ablines to the different facets by
specifying with subset commands. As you might see, there are still a few
issues.
1.) I would like to have the diamonds in a grey scale instead of colors. I
accomplished this (see graph 2) until I overwrote the label title for the
treatments and the colors came back (graph 1). I used these two commands:
p=ggplot(data =
2023 Dec 14
0
R-help Digest, Vol 250, Issue 13
Kevin,
Maybe also look at what air quality monitoring is being done in area.
https://cran.r-project.org/web/packages/RAQSAPI/vignettes/RAQSAPIvignette.html
Depends what and how near, but might be something relevant there?
Karl
Dr Karl Ropkins
Transport Studies | Environment | University of Leeds
------------------------------
Message: 2
Date: Tue, 12 Dec 2023 07:52:59 -0800
From: Bert Gunter
2008 Dec 14
0
New version of ggplot2, 0.8.1
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2008 Dec 14
0
New version of ggplot2, 0.8.1
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2012 Dec 12
1
ggplot - adding regression lines
Hi
I am using ggplot to overlay two regression lines on a scatter plot each
corresponding to a treatment group.
The default plot gives a different slope for each treatment group. However,
in some cases i want the lines to be parallel -ie no significant
interaction.
My code:
ggplot(data=df,X,Y,colour=treatment) + geom_point() +
geom_smooth(method="lm")
I think i use the
2023 Aug 12
2
geom_smooth
Colleagues,
Here is my reproducible code for a graph using geom_smooth
set.seed(55)
scatter_data <- tibble(x_var = runif(100, min = 0, max = 25)
?????????????????????? ,y_var = log2(x_var) + rnorm(100))
library(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")+