Displaying 11 results from an estimated 11 matches for "geom_raster".
2017 Sep 13
0
ggmap + geom_raster
...+
scale_alpha(range = c(0,0.3), guide=FALSE)
The above computes 2d density but it does not take the score (the weight
into account). To do a weighted KDE I do :
library(ks)
mydensity <- kde(x = s_rit[,c(2,3)],w = s_rit$score)
This computes a weighted KDE,but the data can't be passed to geom_raster
because the x,y's are 151 each while the estimated density is a matrix 151
x 151. However this can be accepted by image as shown below.
library(reshape2)
library(ggplot2)
x <- mydensity$eval.points[[1]]
y <- mydensity$eval.points[[2]]
z <- mydensity$estimate
image(x,y,z)
How can I...
2013 Mar 25
2
Plot Matrix with Data
...ngthOut<-5
Lengths<- 15
library(reshape2)
library(ggplot2)
tdm <- melt(Data)
ggplot(tdm, aes(x = Var2, y = Var1, fill = factor(value)),levels=seq(0,1,by=0.1)) +
labs(x = "MHz", y = "Threshold", fill = "Duty Cycle") +
geom_raster(alpha=1) +
scale_fill_discrete(h.start=1,breaks=c(20,30,40,50,60,70,80,90),labels=c(20,30,40,50,60,70,80,90),fill="red") +
scale_x_continuous(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0))
# End of code part
What I w...
2013 Feb 14
2
Plot a Matrix as an Image with ggplot
...be labeled as
str(yLabel)
?num [1:21] -88 -87 -86 -85 -84 -83 -82 -81 -80 -79 ...
I have found on the internet that I can do something like that with ggplot2.
For example
you can run the following
library(reshape2)library(ggplot2)m =matrix(rnorm(20),5)ggplot(melt(m),aes(Var1,Var2,fill=value))+geom_raster()
What I see missing here is to get my matrix and transform it to a data frame with labels for x and y axis so as ggplot can print the values nice. If you get the idea this matrix will be printed as a two tile pattern let's say with black tiles zeros and white tiles black where a color bar wil...
2013 Feb 20
1
ggplot2 customizing a plot
...
tdm <- melt(DataToPlot)
p<- ggplot(tdm, aes(x = Var2, y = Var1, fill = factor(value))) +
labs(x = "MHz", y = "Threshold", fill = "Duty Cycle") +
geom_raster() +
scale_fill_discrete()
[[alternative HTML version deleted]]
2017 Nov 17
2
How to produce rainfall maps
...ropriate column headings
colnames(df) <- c(?Longitude?, ?Latitude?, ?MAP?)
#Call in point data, in this case a fake transect (csv file with lat and lon coordinates)
sites <- data.frame(read.csv(?/your/path/to/pointfile.csv?))
#Now make the map
ggplot(data=df, aes(y=Latitude, x=Longitude)) +
geom_raster(aes(fill=MAP)) +
geom_point(data=sites, aes(x=x, y=y), color=?white?, size=3, shape=4) +
theme_bw() +
coord_equal() +
scale_fill_gradient(?MAP (mm/yr)?, limits=c(0,2500)) +
theme(axis.title.x = element_text(size=16),
axis.title.y = element_text(size=16, angle=90),
axis.text.x = element_text(size=14...
2013 Feb 25
1
ggplot2 Increase font size
Dear all,
I am using the code as below
tdm <- melt(matrixToPlot)
p<- ggplot(tdm, aes(x = Var2, y = Var1, fill = factor(value))) +
labs(x = "Mz", y = "T", fill = "D") +
geom_raster(alpha=1) +
scale_fill_discrete(h.start=1) +
scale_x_continuous(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0))
to plot an two dimensional image .
I would like to ask your help to replace the gray border with white color and increase t...
2017 Nov 21
0
How to produce rainfall maps
...(df) <- c(?Longitude?, ?Latitude?, ?MAP?)
>
> #Call in point data, in this case a fake transect (csv file with lat and lon coordinates)
> sites <- data.frame(read.csv(?/your/path/to/pointfile.csv?))
>
> #Now make the map
> ggplot(data=df, aes(y=Latitude, x=Longitude)) +
> geom_raster(aes(fill=MAP)) +
> geom_point(data=sites, aes(x=x, y=y), color=?white?, size=3, shape=4) +
> theme_bw() +
> coord_equal() +
> scale_fill_gradient(?MAP (mm/yr)?, limits=c(0,2500)) +
> theme(axis.title.x = element_text(size=16),
> axis.title.y = element_text(size=16, angle=90),
>...
2017 Nov 22
2
How to produce rainfall maps
Fwiw the engine behind geom_raster needs explicit observation-per-row form
for input (with no structural normalization), so conversion to points is
perfectly proper here, albeit confusing in context. (It's closer to what
graphics devices actually use ultimately, but the expansion is laid out
very early in ggplot2 because there&...
2017 Nov 23
0
How to produce rainfall maps
...regione.marche.it
---Oo---------oO----------------
________________________________
Da: Michael Sumner [mdsumner at gmail.com]
Inviato: mercoled? 22 novembre 2017 10.48
A: Sarah Goslee
Cc: Stefano Sofia; r-help at r-project.org
Oggetto: Re: [R] How to produce rainfall maps
Fwiw the engine behind geom_raster needs explicit observation-per-row form for input (with no structural normalization), so conversion to points is perfectly proper here, albeit confusing in context. (It's closer to what graphics devices actually use ultimately, but the expansion is laid out very early in ggplot2 because there&...
2012 Mar 02
0
ggplot2 0.9.0
...tions inside the plot area (Contributed by Baptiste
Augui?).
* `geom_map`: a new special case of `geom_polygon` useful when you are drawing
maps, particularly choropleth maps. It is matched with `annotation_map`, an
even faster special case when you want the same map drawn in each panel.
* `geom_raster` is a special case of `geom_tile` for equally sized rectangular
tiles. It uses the raster functionality of R graphics devices for massively
increased speed and much decreased file sizes. It is matched with
`annotation_raster`, an even faster special case, for when you want to draw
the same...
2012 Mar 02
0
ggplot2 0.9.0
...tions inside the plot area (Contributed by Baptiste
Augui?).
* `geom_map`: a new special case of `geom_polygon` useful when you are drawing
maps, particularly choropleth maps. It is matched with `annotation_map`, an
even faster special case when you want the same map drawn in each panel.
* `geom_raster` is a special case of `geom_tile` for equally sized rectangular
tiles. It uses the raster functionality of R graphics devices for massively
increased speed and much decreased file sizes. It is matched with
`annotation_raster`, an even faster special case, for when you want to draw
the same...