Displaying 20 results from an estimated 34 matches for "geom_polygon".
2012 Feb 06
1
ggplot2 geom_polygon fill
...o groups. mRS is a scale for disability or
daily activities competence.
It looks like this.
http://r.789695.n4.nabble.com/file/n4361919/rankinplot.png
I just wish the polygons in between the bars would fill in the same colors
as the bar segments do.
Interestingly, in the example provided by the geom_polygon help page, there
is a fill, which leads me to suspect that something with my data frame might
be wrong.
If I supply a "colour" argument, I get borders, but not always in the color
I defined. The attached image has such borders, to make clear what polygons
I am talking about. In the final...
2013 Mar 07
3
ggplot2 y elipse.
Buenas tardes,
Estoy intentando mejorar un gráfico que construyo pero de manera "bruta" y
quiere encontrar una manera más eficiente.
El gráfico en cuestión tiene más partes pero para simplificar la parte que
me interesa es esta:
[image: Imágenes integradas 5]
Esto es una elipse de confianza de unos puntos, la elipse la consigo
ayudándome de dataEllipse (paquete car), para llegar a
2012 Dec 12
1
Problems with plot maps
Hello,
I need plot map using ggplot()
I use such code:
library("ggplot2")
library(cshapes)
cshp.data <- cshp()
map <- cshp.data[cshp.data$COWCODE==369,]
map_mp<- list(
geom_polygon(aes(long, lat, group = group), data = map, fill = "grey70",
colour = "grey60", inherit.aes = FALSE, show_guide = FALSE),
scale_x_continuous("", breaks = NULL, expand = c(0.02, 0)),
scale_y_continuous("", breaks = NULL, expand = c(0.02...
2010 Jun 23
1
Shapefile
...readOGR(dsn=dsn, layer="PNW_wolf_habitat_grid")
class(wolves.map)
dim(wolves.map)
head(wolves.map,1)
names(wolves.map)
gpclibPermit()
wolves.ds <- fortify(wolves.map)
head(wolves.ds);tail(wolves.ds)
# Shapefile of 5 states
wolves.plot <- ggplot(wolves.ds,aes(long,lat,group=group)) +
geom_polygon(colour='white',fill='lightblue')
wolves.plot
# How to show the state borders of Washington, Oregon, Idaho, Montana
and Wyoming on map?
# Subset from wolves to create a logistic regression model based on
WOLVES_99 and then apply to all the 5 states
# Remove the WOLVES_99 2(two value...
2010 Jun 23
1
Plotting Data on a Map
...readOGR(dsn=dsn, layer="PNW_wolf_habitat_grid")
class(wolves.map)
dim(wolves.map)
head(wolves.map,1)
names(wolves.map)
gpclibPermit()
wolves.ds <- fortify(wolves.map)
head(wolves.ds);tail(wolves.ds)
# Shapefile of 5 states
wolves.plot <- ggplot(wolves.ds,aes(long,lat,group=group)) +
geom_polygon(colour='white',fill='lightblue')
wolves.plot
# How to show the state borders of Washington, Oregon, Idaho, Montana
and Wyoming on map?
# Subset from wolves to create a logistic regression model based on
WOLVES_99 and then apply to all the 5 states
# Remove the WOLVES_99 2(two value...
2012 Feb 01
3
Plotting bar graph over a geographical map
...t I can't figure out how to use it.
Thank you for your help,
Simon
### R-code
library(ggplot2)
library(maps)
measurements <- read.csv("all_podo.count.csv", header=T)
allworld <- map_data("world")
pdf("map.pdf")
ggplot(measurements, aes(long, lat)) +
geom_polygon(data = allworld, aes(x = long, y = lat, group = group),
colour = "grey70", fill = "grey70") +
geom_point(aes(size = ref)) +
opts(axis.title.x = theme_blank(),
axis.title.y = theme_blank()) +
geom_bar(aes(y = normcount))
dev.off()
###
--
View this message in context:...
2015 Sep 04
2
Añadir escala a un mapa
...geom_point(data=datos, aes(shape = INSTRUMENTACIÓN, color=INSTRUMENTACIÓN, fill=INSTRUMENTACIÓN), size=7.5) +
geom_text(data=coord.geog[1:7,], aes(x=coord.geog$lon[1:7], y=coord.geog$lat[1:7], label=nombres.pluvio, hjust=0.2, vjust=1), size=5.2) +
scale_shape_manual(values=c(21,24,22,23)) +
geom_polygon(aes(x=long, y=lat, group=group), data=area.fort, colour="black", fill="brown", alpha=0.15, size=0.5, linetype=5)
dev.off()
Mi duda es:
¿Cómo puedo añadir una escala en km a esa imagen (mapa)?
Gracias de antemano,
Saludos,
Marcos
[[alternative HTML version d...
2009 Sep 14
1
ggplot2 legend text....a basic question
...n learning to use the ggplot2 library, and after a full day of
work I still have a couple of basic questions.
Here is an example:
mydata=data.frame(x=runif(20),y=runif(20),n=runif(20))
mydata2=data.frame(x=c(0.4,0.6,0.5),y=c(0.4,0.4,0.6))
ggplot(mydata, aes(x, y)) + geom_point(aes(size = n)) +
geom_polygon(data=mydata2,aes(x,y,alpha=0.5))
In this plot, the points are labeled as "n" (the name of the variable)
and the polygon is labeled as "0.5" (the alpha value used). My
questions are:
a) How to change the text in the legend (for example, "number" instead
of "...
2010 Jun 24
0
rgdal-maptools
...readOGR(dsn=dsn, layer="PNW_wolf_habitat_grid")
class(wolves.map)
dim(wolves.map)
head(wolves.map,1)
names(wolves.map)
gpclibPermit()
wolves.ds <- fortify(wolves.map)
head(wolves.ds);tail(wolves.ds)
# Shapefile of 5 states
wolves.plot <- ggplot(wolves.ds,aes(long,lat,group=group)) +
geom_polygon(colour='white',fill='lightblue')
wolves.plot
# How to show the state borders of Washington, Oregon, Idaho, Montana and Wyoming on map?
# Subset from wolves to create a logistic regression model based on WOLVES_99 and then apply to all the 5 states
# Remove the WOLVES_99 2(two value...
2017 Oct 09
2
example of geom_contour() with function argument
...gplot2 and I do not know the answer to your question. I
> looked around a bit but could not find an answer right away. But one
> possibility could be, if a direct approach is not possible, to draw
> ellipses corresponding to the confidence regions of the multivariate t
> density and use geom_polygon to draw this successively?
>
> I will wait for a couple of days to see if there is a better answer posted
> and then write some code, unless you get to it first.
>
> Thanks,
> Ranjan
>
>
> On Sun, 8 Oct 2017 09:30:30 -0500 Big Floppy Dog <bigfloppydog at gmail.com>...
2013 Jan 28
1
Adding 95% contours around scatterplot points with ggplot2
...0,0.4,0.25))
data<-data.frame(level=c(rep(1, 30),rep(2,30), rep(3,30)), x=x,y=y)
find_hull <- function(data) data[chull(data$x, data$y), ]
hulls <- ddply(data, .(level), find_hull)
fig1 <- ggplot(data=data, aes(x, y, colour=(factor(level)),
fill=level))+geom_point()
fig1 <- fig1 + geom_polygon(data=hulls, alpha=.2)
fig1
[[alternative HTML version deleted]]
2011 Apr 03
1
another question on shapefiles and geom_point in ggplot2
...a_out.csv")
head(manuel_points);dim(manuel_points)
# fortify this one too for the points or else an error will ocurr
manuel_points <- fortify(manuel_points)
manuel_points
# Plot the shapefile and overlayed the points over it
p <- ggplot(manuel_merged, aes(long,lat,group=group)) +
geom_polygon(aes(data=manuel_merged,fill=Area_Influ)) +
geom_path(color="white") + theme_bw() # remove this if you don't want black
and white background
p + geom_point(data=manuel_points,aes(size=ACE,colour=ACE,group=NULL)) +
scale_size(name = "Número\nde\nespecies", breaks = c(2,...
2017 Oct 08
0
how to overlay 2d pdf atop scatter plot using ggplot2
...I am no expert on ggplot2 and I do not know the answer to your question. I looked around a bit but could not find an answer right away. But one possibility could be, if a direct approach is not possible, to draw ellipses corresponding to the confidence regions of the multivariate t density and use geom_polygon to draw this successively?
I will wait for a couple of days to see if there is a better answer posted and then write some code, unless you get to it first.
Thanks,
Ranjan
On Sun, 8 Oct 2017 09:30:30 -0500 Big Floppy Dog <bigfloppydog at gmail.com> wrote:
> Note: I have posted this on...
2017 Oct 09
0
example of geom_contour() with function argument
...oked around a bit but could not find an answer right away. But one
>> >>>> possibility could be, if a direct approach is not possible, to draw
>> >>>> ellipses corresponding to the confidence regions of the multivariate t
>> >>>> density and use geom_polygon to draw this successively?
>> >>>>
>> >>>> I will wait for a couple of days to see if there is a better answer
>> >>> posted
>> >>>> and then write some code, unless you get to it first.
>> >>>>
>> >>...
2015 Nov 13
2
Colores en labels de un mapa
...n(base_shape,base_puntos,base_titulos){
##Se requiere crear un factor para ubicar los puntos dentro del mapa
base_puntos<-cbind(base_puntos,categoria="Agencia")
base_puntos$categoria <- factor(base_puntos$categoria,levels =
c("Agencia"))
grafico<-ggplot() +
geom_polygon(data = base_shape, aes(x = long, y = lat, group = group,
fill = valor), color = "black", size = 0.25) +
scale_fill_distiller(palette = "Reds", guide="colourbar") +
theme_nothing(legend = TRUE) +
geom_point(data = base_puntos, aes(x = long.agencia.utm, y
=la...
2017 Oct 09
3
example of geom_contour() with function argument
...;>> looked around a bit but could not find an answer right away. But one
> >>>> possibility could be, if a direct approach is not possible, to draw
> >>>> ellipses corresponding to the confidence regions of the multivariate t
> >>>> density and use geom_polygon to draw this successively?
> >>>>
> >>>> I will wait for a couple of days to see if there is a better answer
> >>> posted
> >>>> and then write some code, unless you get to it first.
> >>>>
> >>>> Thanks,
> &g...
2017 Oct 08
2
how to overlay 2d pdf atop scatter plot using ggplot2
Note: I have posted this on SO also but while the question has been
upvoted, there has been no answer yet.
https://stackoverflow.com/questions/46622243/ggplot-plot-2d-probability-density-function-on-top-of-points-on-ggplot
Apologies for those who have seen it there also but I thought that this
list of experts may have someone who knows the answer.
I have the following example code:
2017 Oct 09
0
example of geom_contour() with function argument
...the answer to your question.
> I
> > looked around a bit but could not find an answer right away. But one
> > possibility could be, if a direct approach is not possible, to draw
> > ellipses corresponding to the confidence regions of the multivariate t
> > density and use geom_polygon to draw this successively?
> >
> > I will wait for a couple of days to see if there is a better answer
> posted
> > and then write some code, unless you get to it first.
> >
> > Thanks,
> > Ranjan
> >
> >
> > On Sun, 8 Oct 2017 09:30:30 -0500...
2017 Oct 09
2
example of geom_contour() with function argument
...gt;> question. I
>> > looked around a bit but could not find an answer right away. But one
>> > possibility could be, if a direct approach is not possible, to draw
>> > ellipses corresponding to the confidence regions of the multivariate t
>> > density and use geom_polygon to draw this successively?
>> >
>> > I will wait for a couple of days to see if there is a better answer
>> posted
>> > and then write some code, unless you get to it first.
>> >
>> > Thanks,
>> > Ranjan
>> >
>> >
>>...
2008 Jan 27
1
Putting frame around single panels in ggplot 2 and facet_grid()
Hi
I want to highlight two panels in a grid created with facet_grid() by
putting a box around it or usiong another background colour. Is this
possible, and if yes, how?
Thanks
Rainer
--
Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)
Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa
Tel: +27 - (0)21 650 5776 (w)
Fax: