search for: geom_path

Displaying 20 results from an estimated 53 matches for "geom_path".

2018 Nov 14
2
Los puntos no tapen el mapa hecho ggplot
...con el código que os copio abajo, pero me gustaría que me dibujase las líneas del mapa después de poner los puntos para que se vean. Puedo hacer los puntos más pequeños, pero entonces quedan separados y yo quiero que rellenen el mapa. Gracias, como siempre, Manuel print(ggplot(legend=FALSE)+geom_path(data=map_data('world'), aes(x=long, y=lat,group=group))+ theme(panel.background=element_blank())+theme(panel.grid.major = element_blank())+ theme(panel.grid.minor = element_blank())+theme(axis.text.x=element_blank(),axis.text.y=element_blank())+...
2020 Jul 28
2
Superponer mapas en ggplot
...combinación de las dos, que me permitiera hacer eso mismo, pero no encuentro la forma. Gracias por vuestra ayuda, una vez más, Manuel ggplot(legend=FALSE)+ geom_point(data=NCDS,aes(x=lon,y=lat,color= PA),shape=15,size=1) + scale_color_manual(values=c("white","grey70"))+ geom_path(data=map_data('world'), aes(x=long, y=lat,group=group)) ggplot(legend=FALSE)+ geom_point(data=NCDS,aes(x=lon,y=lat,color= ExtTG7085),shape=15,size=1) + # PTP o FTP scale_colour_gradient2(low = "white",high="RED",midpoint=0,guide="colourbar",limits=c(0,200)...
2012 Mar 20
1
passing xlim to coord_map in ggplot2
...aven't been able to find an example of this on Nabble or SO, so thought I'd ask. This works: michigan <- map_data('county', 'michigan') mich_points <- data.frame(x = rnorm(n = 200, median(michigan[,1]), 0.75), y = rnorm(n = 200, median(michigan[,2]), 0.75)) ggplot() + geom_path(aes(long, lat, group = group), data = michigan) + geom_point(aes(x, y), data = mich_points) + coord_map('gilbert', xlim = c(-86, -84)) This generates the following error: *Error in unit(x, default.units) : 'x' and 'units' must have length > 0* #Where tank_trunc is a data...
2007 Sep 27
3
Plotting from different data sources on the same plot (with ggplot2)
...: the coordinates of the coastlines in a region of interest and the coordinated of sampling stations in a subset of this region. I want to plot the coastline as a line and the stations as points, on the same graph. I can plot them independently easily: p1 = ggplot(coast,aes(x=lon,y=lat)) + geom_path() + coord_equal(ratio=1) p1$aspect.ratio = 1 p2 = ggplot(coords,aes(x=lon,y=lat)) + geom_point() + coord_equal (ratio=1) p2$aspect.ratio = 1 but I cannot find how to combine the two graphs. I suspect this has probably to be done via different layers but I really can't find how. In partic...
2013 Mar 07
3
ggplot2 y elipse.
...ntes de "DENTRO" y el "FUERA" después de "DENTRO" y así poder construir el gráfico anterior que está construido en trozos, si pongo colores: [image: Imágenes integradas 4] Alguien tiene alguna sugerencia de como conseguir esto pero sin tener que hacer un mallado, con geom_path puedo dibujar la elipse pero no se hacer lo que quiero. Adjunto un código reproducible con lo que tengo (en el código hay algunos for que supongo que se podrían juntar pero lo que realmente hace lento el proceso es la sentencia apply(malla[,1:2],1,cual) que es lo que quiero evitar) Muchas gracia...
2018 Dec 12
2
Subset dentro de un for
...o funciona poniendo GT[i] (como se ve abajo). Pretendo que me haga 20 mapas, cada uno de acuerdo a una de las 20 variables de GT. GT<- c("var1","var2", ? "var20") for(i in GT) { df2<-subset(df1, subset=get(GT[i])>0) windows();print(ggplot(legend=FALSE)+geom_path( data=world, aes(x=long, y=lat,group=group))+ theme(panel.background=element_blank())+theme(panel.grid.major = element_blank())+ theme(panel.grid.minor = element_blank())+theme(axis.text.x=element_blank(),axis.text.y=element_blank())+ theme(axis.ticks = element_bl...
2008 Feb 16
1
ggplot2 & ribbon
....7, 57.8, 67.5, 67.8, 66.4, 70.3, 60.3, 64.7, 60, 61.1, 60.3)), .Names = c("Date", "Geog", "Type", "variable", "value"), row.names = c(NA, -108L), class = "data.frame ") I then run ... p<-ggplot(reading.melt,aes(x=Date,y=value)) p+geom_path(aes(colour=Type),size=2)+facet_grid(variable~.) but can't figure out (1) How to add a transparent shade between the Paid & Total lines. I've tried the ribbon function, but cant seem to get it to shade between the lines (2) Add a left justified title to the chart Any help very gratefu...
2018 Dec 12
2
Subset dentro de un for
...;> mapas, cada uno de acuerdo a una de las 20 variables de GT. >> >> GT<- c("var1","var2", ? "var20") >> >> for(i in GT) { >> >> df2<-subset(df1, subset=get(GT[i])>0) >> >> windows();print(ggplot(legend=FALSE)+geom_path( data=world, >> aes(x=long, y=lat,group=group))+ >> theme(panel.background=element_blank())+theme(panel.grid.major = >> element_blank())+ >>         theme(panel.grid.minor = >> element_blank())+theme(axis.text.x=element_blank(),axis.text.y=element_blank())+ >>   ...
2009 Nov 04
0
Weird errors with R CMD check/ggplot2 in examples: how to debug?
...r diagnose or understand the error (shown below). How can I debug this? i.e., Is there something I can add to the example to help track down the cause of these errors? Has anyone experienced anything similar? \examples{ require(ggplot2) plot_troops <- ggplot(Minard.troops, aes(long, lat)) + geom_path(aes(size = survivors, colour = direction, group = group)) plot_both <- plot_troops + geom_text(aes(label = city), size = 4, data = Minard.cities) plot_polished <- plot_both + scale_size(to = c(1, 12), breaks = c(1, 2, 3) * 10^5, labels = comma(c(1, 2, 3) * 10^5)) + scale_colour_manual...
2008 Oct 09
1
Biplot connecting consecutive dates (ggplot?)
I would like to connect the dots based on when they occur in time. Is there an easy way to do this? thanks f <- (structure(list(date = structure(c(1L, 2L, 3L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 4L, 5L, 6L, 7L, 8L, 9L, 2L, 3L, 10L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 4L, 5L, 6L, 7L, 9L ), .Label = c("1/1/03", "1/1/04", "1/1/06", "10/1/02",
2010 Nov 01
1
ggplot map bounds
...ng with code below to produce a map with station data plotted in points, but right now I'm having trouble with the mapping portion of this code states <- data.frame(map("state", plot=FALSE,xlim= c(-85,-75),ylim=c(33,37))[c("x","y")]) usamap<- ggplot(states)+geom_path(aes(x,y)) usamap When I plot this the problem is that the bounds of the plot is from 31N to 38N and 90W to 75W. The problem is that I only need the bounds of the plot to be from 33N to 37N and 85W to 75W. The way this is now, if I try to subset the states object, I get a garbled mess of lines....
2019 Sep 19
2
ggplot con gradientes complejos
...= element_blank()) + xlab("") + ylab("")+ geom_point(data=SGData2,aes(x=lon,y=lat,color=Ch7085),shape=15,size=1.5) + * scale_colour_gradient2(limits=c(-400, 200),low = "blue",high="red",midpoint=0*, guide="colourbar")+geom_path(data=world, aes(x=long, y=lat,group=group))+ labs(title = "ch7085") [[alternative HTML version deleted]]
2009 Feb 25
0
ggplot2 0.8.2
...ments * theme_text: now possible to right and left align text with hjust=0 and hjust=1 respectively Bug fixes * be explicit about plyr::is.discrete to avoid clash with Hmisc * facet_wrap: work around R bug so no longer crashers when ncol = 1 * geom_errorbar now works correctly with dashed lines * geom_path will now silently ignore lines with less than 2 points (instead of throwing a mysterious error as before) * geom_path now responds to the size aesthetic once more * geom_polygon etc now correctly displays linetype on legends * geom_step now works with multiple groups * geom_vline and geom_hline: fi...
2009 Feb 25
0
ggplot2 0.8.2
...ments * theme_text: now possible to right and left align text with hjust=0 and hjust=1 respectively Bug fixes * be explicit about plyr::is.discrete to avoid clash with Hmisc * facet_wrap: work around R bug so no longer crashers when ncol = 1 * geom_errorbar now works correctly with dashed lines * geom_path will now silently ignore lines with less than 2 points (instead of throwing a mysterious error as before) * geom_path now responds to the size aesthetic once more * geom_polygon etc now correctly displays linetype on legends * geom_step now works with multiple groups * geom_vline and geom_hline: fi...
2012 Apr 04
1
Subscript Error
...dat_add <- ldply(json_dir[[i]], function(x) t(data.frame(x)), .progress = "text") names(dat_add) <- c("lat", "lon") json_path <- c(json_path, list(dat_add)) } p = p + geom_path(aes(lon, lat), data = json_path[[i]]) } print(paste("Processed ", i, " of ", as.character(length(json_dir)), " in route set.", sep = "")) } This runs until i = 101 and then errors out with, "Error in json_path[[i]] : subscript out o...
2008 Aug 07
2
lattice: add vertical lines in xyplot
...{ > panel.xyplot(x, y,subscripts, ...) > panel.abline(v=my.lines[subscripts])} > ) this gives me an error, but I don't understand the help for the panel function. Alternatively, I tried in ggplot but here again, I get an error: > p <- ggplot(my.df, aes(x, y)) + > geom_path(aes(colour = fact)) + > facet_grid(fact2 ~ fact) + > geom_vline(intercept = my.lines) # how do I select the relevant > one ? > p Many thanks, baptiste _____________________________ Baptiste Augui? School of Physics University of Exeter Stocker Road, Exeter, Devon, EX4 4QL, U...
2011 Mar 15
1
Changing colour of continuous time-series in ggplot2
...ed on whether the trial value is TRUE or FALSE, so I try: ggplot(myDF, aes(time,value)) + geom_line(aes(colour=trial)) but this draws a line from the value on row 3 to that on row 8 (essentially plotting TRUE and FALSE as separate data-sets). I've tried using various other geometries (inc. geom_path()) but all have produced similar events. Is there a way I can plot the time-series in a continuous way (i.e. as one data-set) and change only the colour of the line? Thanks, Joe -- View this message in context: http://r.789695.n4.nabble.com/Changing-colour-of-continuous-time-series-in-ggplot2...
2012 Aug 03
1
Plotting Where People Live on a U.S. Map
...quot;) Warning message: package 'map' is not available (for R version 2.15.0) # The code I tried to run: states <- data.frame(map("state", plot=FALSE)[c("x","y")]) colnames(states) <- c("Lon","Lat") ggplot(states, aes(x=Lon, y=Lat)) + geom_path() + geom_point(alpha=0.6,size=0.3,data=subway) # Where I got the code from and also an image of what I am attempting to do (please enter this in your URL) http://www.google.com/imgres?um=1&hl=en&biw=1790&bih=845&tbm=isch&tbnid=4rMjXYA_w1qDiM:&imgrefurl=http:...
2007 Nov 23
1
ggplo2: fixed extent greater than data?
...ut exactly the same extent in each plot. Is there a way of switching the automatic extent (to the data of the last layer added) OFF? I'm trying something like: drawOverviewMap<-function(){ p2<-ggplot(xlimits=c(2,20),ylimits=c(43,50))+coord_map(project="azequalarea") p2<-p2+geom_path(data=wa,mapping=aes(x=x,y=y)) p2<-p2+geom_point(data=spts,mapping=aes(x=Lon,y=Lat)) return(p2) } If I plot this in cartesian coordinates, it will zoom to the extent of the country boundaries "wa", plus some extra space around it (since this is the dataset with the widest range). Thi...
2009 Dec 22
0
ggplot2 version 0.8.5
...contour bump up default number of contours * stat_density2d: make number of grid points used for density estimation user controllable (implements #9) * geom_bin now allows you to set whether bins used intervals of the form (a, b] or [a, b) with the "right" parameter (implements #20) * geom_path: linejoin, lineend and linemitre are now user controllable (implements #24) * scales: all scales check that breaks are supplied if labels are, and that breaks and labels are the same length (implements #40) * scales: if breaks are a named vector, the names will be used as labels (thanks to su...