In order to have the colored layer (mean) appear as the multi-polygon that it does, I've had to take some undesirable measures. I've taken a data frame of mean values corresponding to lat and long coordinates, which is at a 1 degree resolution, converted it to a raster, up-sized the raster by 10^5x pixels, clipped the resulting monster-raster to the boundaries of a multi-polygon in a shapefile using gdal_translate (outside of R), imported the up-sampled and clipped raster back into R, and finally plotted it. All that, simply to mask the area of interest for the plot.
It has occurred to me that xlim() and ylim() drop data outside of the constraints provided by their arguments. If those constraints could represent a multi-polygon, then I could use the original data, saving me the hassle of all that file manipulation and more importantly, speeding up the plotting by reducing the size of the data by a rather large factor. So my question is, can xlim() and ylim() accept geometries as arguments and if so, then how?
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi All,
I was making a bar plot step by step and I want to change the resolution and other futures for journal publication.
I tried to following code and I got the graphic, but I do not know the plot name. I need to plot it after change the resolution.
Please help me
a <- c(1, 3, 9, 11, 29)
b <- c(5, 8, 11, 22, 30)
means <- c(mean(a), mean(b))
mp <- barplot(means, axes=FALSE, axisnames=FALSE, ylim=c(0, 60),
+ col=c(red, blue), main="Average age", xlab="Group", ylab="Age")
mp <- barplot(means, axes=FALSE, axisnames=FALSE, ylim=c(0, 60),
+ col=c(green, blue), main="Average age", xlab="Group", ylab="Age")
mp <- barplot(means, axes=FALSE, axisnames=FALSE, ylim=c(0, 60),
+ main="Average age", xlab="Group", ylab="Age")
axis(1, labels=c("A", "B"), at = mp)
axis(2, at=seq(0 , 60, by=5))
box()
stDevs <- matrix(c(sd(a), sd(b)), 2)
segments(mp, means - stDevs, mp, means + stDevs, lwd=2)
segments(mp - 0.1, means - stDevs, mp + 0.1, means - stDevs, lwd=2)
segments(mp - 0.1, means + stDevs, mp + 0.1, means + stDevs, lwd=2)
png(filename = "mp.png",
+ width = 4800, height = 4800, units = "px", pointsize = 12,
+ bg = "white", res = 1000, family = "", restoreConsole = TRUE,
+ type = c("windows"))
plot(mp)?----this is my question what is the final plot name.
dev.off()
RStudioGD
2
Cheers,
Mahmut
| ALBURY-WODONGA | BATHURST | CANBERRA | DUBBO | GOULBURN | MELBOURNE | ONTARIO | ORANGE | PORT MACQUARIE | SYDNEY | WAGGA WAGGA |
Charles Sturt University in
Australia The Grange Chancellery, Panorama Avenue, Bathurst NSW Australia
2795 (ABN: 83 878 708 551; CRICOS Provider Number: 00005F (National)). TEQSA
Provider Number: PV12018
Charles Sturt University in Ontario 860
Harrington Court, Burlington Ontario Canada L7N 3N4 Registration: www.peqab.ca
