search for: linetyp

Displaying 20 results from an estimated 106 matches for "linetyp".

Did you mean: linetype
2017 Oct 12
1
dual y-axis for ggplot
Hi John, You can try the following: override.linetype=c("twodash","solid") p <- ggplot(obs, aes(x = Timestamp)) p <- p + geom_line(aes(y = air_temp, colour = "Temperature", linetype ="Temperature")) p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity", linetype="Humidity")) p &...
2017 Oct 12
2
dual y-axis for ggplot
...nt 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 linetype "solid"? For convenience, I copied the codes as follows. ######## p <- ggplot(obs, aes(x = Timestamp)) p <- p + geom_line(aes(y = air_temp, colour = "Temperature")) # adding the relative humidity data, tr...
2017 Oct 12
0
dual y-axis for ggplot
Sorry let me clarify. If I modify the line p <- p + geom_line(aes(y = air_temp, colour = "Temperature")) by p <- p + geom_line(aes(y = air_temp, colour = "Temperature", linetype ="Temperature")) and p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity")) by p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity", linetype="Humidity")) and p <- p + scale_linetype_manual(values = c("twodash", "solid"...
2018 Jul 18
2
Legendas en una gráfica de ggplot2
...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 (-4, 4, by=0.01) u=exp(t-2)/(1+(exp(t-2))) ####unir los datos b=c(0.3,2,-1,-2) datos=cbind(l,o,i,u) datos=data.frame(datos) ###Graficos ggplot( )+ geom_line(aes(y = i, x=t), color="gray48", size=1.2, linetype="dashed") + geom_line(aes(y = u, x=t), color = "gray48", size=1.2,linetype="twodash")+ geom_line(aes(y = o,x=t), color = "gray48", size=1.2,linetype="longdash") + geom_line(aes(y = l,x=t), color="gray48", size=1.2,linetype="s...
2009 Sep 09
2
ggplot2: mixing colour and linetype in geom_line
Hi all, I try to represent a multiple curve graphic where the x-axis is the temperature and the different y-axes are the different X (X22,X43,X44...) some X corresponds to the same molecule (22 and 44 are for CO2 for instance) so I use the same colour for them. I wanna mix the linetype with the colour to be able to visually see the difference between X43 and X45 The best I have done up to now is this code but it crashes with :"Error in col2rgb(colour, TRUE) : invalid color name 'AA'" if I skip the linetype in geom it works perfectly of course THT_N2_ATGMS...
2018 Jul 18
2
Legendas en una gráfica de ggplot2
...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 variable, y para > eso tienes que modificar un poco tus datos. Los has creado en formato > "wide" (ancho), donde tienes la columna t y una columna para cada curva. > Pero para lo que quieres hacer en ggplot, necesitas un formato "long" > (largo), donde tienes...
2018 May 22
3
legend order in ggplot2
...", while it corresponds to "dashed", etc, which I don't want. How could I make "solid" correspond to "name_b"? Thanks, ######### library(ggplot2) df<-data.frame(x1=c(1,2), y1=c(3,4),z1=c(5,6),w1=c(7,8)) p1<-ggplot(df, aes(x=1:2, y=x1))+ geom_line(aes(linetype="name_b"))+ geom_line(aes(x=1:2, y=y1, linetype="name_a"), df)+ geom_line(aes(x=1:2, y=z1, linetype="name_c"), df)+ scale_linetype_manual(name="", values=c("solid","dashed", "dotted"), breaks=c("name_b","nam...
2023 Aug 12
1
geom_smooth
...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")+ > ? 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 > > _______________________...
2013 Feb 01
2
Change default order of colors & line types
...r R users, I'd like to change the default order of colors & line types. Especially I am using ggplot2 and using color Set1. In Set1, the default color order is red, blue, green, violet,.. ect. However, I want to put red in fourth (not first). Likewise, I want to change the order of default linetype. I want to put "solid" line in fourth. How can I do thses? R code to draw the graph is qplot(variable, power, data = m.powers, colour = method, linetype=method, ylab = "Power") + geom_line(aes(group = method), ylim = c(0,1)) + scale_colour_brewer(palette="Set1")...
2013 Mar 06
6
Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?
...ean, colour = factor1, group = factor1, shape = factor1)) + geom_point(aes(shape=factor(factor1)), color="black", fill="white", position = "dodge", width = 0.3, size=3) + geom_line(aes(linetype=factor1), color = "black", size = 0.5) + geom_errorbar(aes(ymin = mean - sdv , ymax = mean + sdv), width = 0.3, position = "dodge", color = "black", size=0.3) + theme_bw() + ylab(expression(paste("my measured stuff"))) + xlab("...
2009 Jan 22
5
Combining Custom and Preset Linetypes
...I have the problem of trying to get the new line into the legend. Does anyone have any ideas about how to combine custom and preset line types? Regards, James http://www.nabble.com/file/p21593760/CRA.gif -- View this message in context: http://www.nabble.com/Combining-Custom-and-Preset-Linetypes-tp21593760p21593760.html Sent from the R help mailing list archive at Nabble.com.
2023 Aug 12
2
geom_smooth
...h 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")+ ? 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
2009 Feb 18
1
lineplot in ggplot2 with different colour and linetype
Hi list, I would like to use ggplot2 in creating a line plot with 4 lines (groups), 2 of which I want in colour and the remaining two as dotted lines. ### R code ### library(ggplot2) ### create data #### vals <- rnorm(400) div<- c(rep("A",100),rep("B",100),rep("C",100),rep("D",100)) n<- rep(1:100,4) df<- data.frame(div=
2012 Jan 19
1
Legend problem in line charts
...xis xrange <- range(refid1$TIME1) yrange <- range(refid1$BASCHGA) # set up the plot pdf (paste("pga", i, ".pdf", sep='')) print(plot(xrange, yrange, type="n", xlab="TIME1 (WK)", ylab="BASCHGA (mm)" )) colors <- rainbow(nACTTRTs) linetype <- c(1:nACTTRTs) plotchar <- seq(18,18+nACTTRTs,1) # add lines for (i in 1:nACTTRTs) { ACTTRT <- subset(refid1, ACTTRTnum==i) print(lines(ACTTRT$TIME1, ACTTRT$BASCHGA, type="b", lwd=1.5, lty=linetype[i], col=colors[i], pch=plotchar[i])) } # add a title and subtitle pa...
2006 Oct 16
2
set linetype with plotCI
Dear R-list, I'm iterating several calls to plotCI [gplots], like so: plotCI( x = xvals.f[sorted], y = yvals.f[sorted], xlim = c(xmin, xmax), ylim = c(ymin, ymax), pch = plot_symbols[graph_idx], type = "b", lty = plot_linetypes[1], col = plot_colors[graph_idx], barcol = plot_colors[graph_idx], uiw = NA, xlab = "", ylab = "", add = (plot_cnt > 0) ) This works fine, the result is four graphs exactly like I want them. Except for one thing, the lty is not used. I understand this is becaus...
2018 May 23
3
Change the legend order by order function
...bottom. Could it be done by order function or its inverse? Thanks, ##### source code library(ggplot2) od<-order(c("name_b", "name_c", "name_a")) df<-data.frame(x1=c(1,2), y1=c(3,4),z1=c(5,6),w1=c(7,8)) p1<-ggplot(df, aes(x=1:2, y=x1))+ geom_line(aes(linetype="name_b"))+ geom_line(aes(x=1:2, y=y1, linetype="name_c"), df)+ geom_line(aes(x=1:2, y=z1, linetype="name_a"), df)+ scale_linetype_manual(name="", values=c("solid","dashed", "dotted")[(od)], labels=c("name_b",&quot...
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 is a hole in the middle of the ribbon? and the color is not grey... On Fri, Oct 23, 2020 a...
2009 Dec 11
2
incorrect linetype with pdf device (PR#14128)
Full_Name: baptiste augui? Version: 2.10.1 RC (2009-12-06 r50690) OS: Mac OSX 10.5 Submission from: (NULL) (90.25.215.172) The following code, run with a vanilla R session, produces different visual output for the two devices, library(grid) pdf("test-pdf.pdf") grid.newpage() grid.lines(gp=gpar(lty="13", lineend = "butt")) dev.off() png("test-png.png")
2013 May 14
1
Tamaño plots y calidad en grafico ggplot
...t 128"){k=i} h <- ggplot(tabla, aes(x=factor(Jurisdiction), y=Mean, ymin=245, ymax=305)) h + scale_fill_manual(values = c("#A0551E", "#FA964B","#E1EBFF", "#B4CDFF", "#055014","#A0551E"))+ geom_hline(yintercept = seq(245, 305, 10), linetype=2, colour="#E1EBFF")+ geom_vline(xintercept = seq(1, 33, 2.5), linetype=1, colour="#E1EBFF")+ geom_vline(xintercept = -2, linetype=1, colour="white")+ geom_vline(xintercept = k, colour="#0000FF20", lwd=5)+ geom_rect(xmin=-2,xmax=-1, mapping=aes(NULL, NULL,...
2020 Oct 23
5
How to shade area between lines in ggplot2
...matrix multiplication slope_1 = -w[1]/w[2] intercept_1 = svm_model$rho / w[2] p = p + geom_abline(slope = slope_1, intercept = intercept_1) ### here we go: can I use a shaded area between these two lines? ### p = p + geom_abline(slope = slope_1, intercept = intercept_1 - 1/w[2], linetype = "dashed") + geom_abline(slope = slope_1, intercept = intercept_1 + 1/w[2], linetype = "dashed") print(p) ``` Thank you -- Best regards, Luigi