Displaying 20 results from an estimated 1000 matches similar to: "ggplot two-factor legend"
2024 Jul 18
1
ggplot two-factor legend
?s 16:27 de 18/07/2024, SIBYLLE ST?CKLI via R-help escreveu:
> Hi
>
> I am using ggplot to visualise y for a two-factorial group (Bio: 0 and 1) x
> = 6 years. I was able to adapt the colour of the lines (green and red) and
> the linetype (solid and dashed).
> Challenge: my code produces now two legends. One with the colors for the
> group and one with the linetype for the
2024 Jul 18
1
ggplot two-factor legend
?s 17:43 de 18/07/2024, Rui Barradas escreveu:
> ?s 16:27 de 18/07/2024, SIBYLLE ST?CKLI via R-help escreveu:
>> Hi
>>
>> I am using ggplot to visualise y for a two-factorial group (Bio: 0 and
>> 1) x
>> = 6 years. I was able to adapt the colour of the lines (green and red)
>> and
>> the linetype (solid and dashed).
>> Challenge: my code
2024 Jul 18
1
ggplot two-factor legend
If I follow your question, you want redundant aesthetics. Ggplot normally notices correlated aesthetic mapping variables and merges the legends, so the most likely answer is that your data are not fully correlated in all rows. I have also seen this where data are drawn from different dataframes for different layers since it is hard to merge factors, but I don't see that here.
You are using
2024 Aug 11
1
geom_smooth with sd
Dear community
Using after_stat() I was able to visualise ggplot with standard deviations
instead of a confidence interval as seen in the R help.
p1<-ggplot(data = MS1, aes(x= Jahr, y= QI_A,color=Bio, linetype=Bio)) +
geom_smooth(aes(fill=Bio,
ymax=after_stat(y+se*sqrt(length(y))), ymin=after_stat(y-se*sqrt(y))) ,
method = "lm" , formula = y ~ x +
2024 Aug 11
1
geom_smooth with sd
Hi!
This is probably completely off base, but your ymin and y max setup lines
are different. One uses sqrt(y), while the second uses sqrt(length(y)).
Could that play a part, please?
Thank you
Erin Hodgess, PhD
mailto: erinm.hodgess at gmail.com
On Sun, Aug 11, 2024 at 10:10?AM SIBYLLE ST?CKLI via R-help <
r-help at r-project.org> wrote:
> Dear community
>
>
>
> Using
2024 Aug 16
2
boxplot notch
Thanks Ben,
Here the reproducible example.
It works without notch=TRUE, but provides an error with notch=TURE
Error in `geom_boxplot()`:
! Problem while converting geom to grob.
? Error occurred in the 1st layer.
Caused by error in `ans[ypos] <- rep(yes, length.out = len)[ypos]`:
! replacement has length zero
Run `rlang::last_trace()` to see where the error occurred.
Warning message:
In
2024 Aug 16
1
boxplot notch
I don't see anything obviously wrong here. There may be something
subtle, but we probably won't be able to help without a reproducible
example ...
On 2024-08-16 9:24 a.m., SIBYLLE ST?CKLI via R-help wrote:
> Dear community
>
>
>
> I tried the following code using geom_boxplot() and notch=TRUE. Does anyone
> know if the command ?notch=TRUE? is at the wrong place in
2024 Aug 16
1
boxplot notch
Dear community
I tried the following code using geom_boxplot() and notch=TRUE. Does anyone
know if the command ?notch=TRUE? is at the wrong place in my special code
construct?
Without notch=TRUE the code provides the planned ggplot.
Kind regards
Sibylle
Code:
MS1<- MS %>% filter(QI_A!="NA") %>% droplevels()
MS1$Jahr<-as.factor(MS1$Jahr)
MS1s <-
2024 Aug 16
1
boxplot notch
That's not really a reprex Sibylle.? I did try to use it to see if I
could work out what you were trying to do and help but there is so much
in there that I suspect is distraction from the notch issue and its
error message.
Please can you give us something stripped of all unecessary things and
tell us what you want?
Something like data that we can read as a tribble() or from a dput() of
2016 Apr 09
1
Run script R
hi all ,?
i have an problem in script R . But when I execute the script R I face this error . can you help me please ???error:-----------------------------------------
Error in FUN(X[[i]], ...) :?? Theme element 'text' has NULL property: margin, debugIn addition: Warning messages:1: Removed 361 rows containing non-finite values (stat_smooth).?2: Removed 361 rows containing missing values
2013 May 14
1
Tamaño plots y calidad en grafico ggplot
Hola a tod en s,
bueno, un poco al hilo de un mensaje anterior, reformulo la pregunta y
pongo código completamente reproducible, a ver si hay más suerte.
Estoy con un informe y hay que hacer algunos gráficos con datos
diferentes con ggplot2, y hay que poner el mismo tamaño para todos
ellos.
El problema es que R cambia automáticamente el tamaño del área de
trazado y el margen en función de
2013 Sep 18
1
ggplot2: changing strip text in facet_grid and a legend text problem
Hi,
Dummy data script and scripts are attached below.
I would like to change the plot to look like this:
2018 May 22
3
legend order in ggplot2
Hi,
I'd like to graph three lines on ggplot2 and I intend the lines to be
"solid", "dashed", and "dotted". The legend names are "name_b", "name_a",
"name_c". I'd like to legend to present in the order: the "name_b" at the
top, and "name_c" at the bottom.
As a consequence, the legend is indeed in the order:
2023 Jun 16
1
Issue with crammed Y axis
Hi,
I have a data frame like this:
> dput(df)
structure(list(ID = 1:8, Type = c("gmx mdrun -ntmpi 8 -ntomp 1 -s
benchPEP.tpr -nsteps 10000 -resethway",
"gmx mdrun -ntmpi 8 -ntomp 1 -s benchPEP.tpr -nsteps 10000 -resethway",
"gmx mdrun -ntmpi 8 -s benchPEP.tpr -nsteps 4000 -resetstep 3000",
"gmx mdrun -ntmpi 8 -s benchPEP.tpr -nsteps 4000 -resetstep
2018 Jul 18
2
Legendas en una gráfica de ggplot2
Buenas tardes, estoy haciendo una gráfica de múltiples lineas pero no he
podido generar las legendas. Alguno de ustedes me podría colaborar.
library(ggplot2)
#### Con b=-2
t=seq (-4, 4, by=0.01)
l=exp(t+2)/(1+(exp(t+2)))
##con b igual a -1
t=seq (-4, 4, by=0.01)
o=exp(t+1)/(1+(exp(t+1)))
### Con b igual a 0.7
t=seq (-4, 4, by=0.01)
i=exp(t-0.7)/(1+(exp(t-0.7)))
### Con b igual a 2
t=seq
2017 Nov 17
2
How to produce rainfall maps
Dear R users,
I need to produce rainfall maps using R.
I know that this is possible, I looked though the web, I found the example below reported (the author is Andrew Tredennick).
I would ask you if this is the most performing way to make rainfall maps; if yes would someone be able to give me an example of how file.asc and pointfile.csv should be? If no would somebody please show me another way
2017 Jun 16
2
point size
Hi all;
I am running the following ggplot codes. Runs well. However, I need to
reflect the numeric values of the log10_P to the point size in the graph.
Your help highly appreciated,
Regards,
Greg
p <- ggplot(mydata, aes(x = X, y = log10_P)) +
theme_bw() +theme(panel.border=element_blank())
+ theme(legend.position="top", axis.text=element_text(size = 8))
(p1 <- p +
2023 Jun 28
1
horizontal grouped stacked plots and removing space between bars
I have code like this:
data <- read.csv("test1.csv", stringsAsFactors=FALSE, header=TRUE)
# Graph
myplot=ggplot(data, aes(fill=condition, y=value, x=condition)) +
geom_bar(position="dodge", stat="identity", width=0.5) +
scale_fill_manual(values=c("#7b3294", "#c2a5cf", "#a6dba0", "#008837"))+
2018 Jul 18
2
Legendas en una gráfica de ggplot2
¡Gracias! Espectacular. Me ha servido mucho.
El mié., 18 de jul. de 2018 1:15 PM, Víctor Granda García <
victorgrandagarcia en gmail.com> escribió:
> Hola Sebastián.
>
> Entiendo que tratas de que aparezca una leyenda con el tipo de curva
> (l,o,u,i). Si quieres aprovechar las ventajas de ggplot (como las leyendas
> automáticas) normalmente tienes que asignar linetype a una
2017 Oct 12
2
dual y-axis for ggplot
Hi,
To my knowledge, an excellent of ggplot with a second y-axis is
https://rpubs.com/MarkusLoew/226759
In this example, the author uses two colors for the two lines, but the
line shapes are the same -- both are solid. Could each line have its own
color as well as its own shape? For example, can I make the red line with
the linetype "twodash", while the blue line with the