Questions tagged [geom-raster]
52 questions
1
vote
1 answer
Filling rows when using facet_grid and geom_raster in ggplot2
Let say I did four measurements/experiments (M1..M4) producing intensity values which vary across 5 locations (loc_1...5). I observed various classes of elements (n=7). Now I would like to summarize the results into a single diagram using facet_grid…

dputhier
- 734
- 1
- 7
- 23
1
vote
1 answer
Plot multiple layers with ggplot2
I am trying to plot two data.frame as two layers using ggplot2 "geom_raster" function. The top layer contains NA values that are set to "transparent" in order to make the underneath layer visible. As the scale_fill_xxx function can't be used twice,…

rnd
- 28
- 5
0
votes
1 answer
ggplot: "No non-missing arguments to min/max; returning Inf"
I'm attempting to recreate this plot (my version: lat/lon by year), but keep getting these warnings after running the ggplot code:
> warnings()
Warning messages:
1: `stat_contour()`: Zero contours were generated
2: In min(x) : no non-missing…

Nate
- 411
- 2
- 10
0
votes
0 answers
creating multi-faceted plot of large geospatial data using geom_raster()
TL;DR: can anyone help w/ geospatial things in R using geom_raster() in ggplot?
Basically it seems that my issue is stemming from the fact that I don't have perfectly gridded values (aka I get this message: "Warning: Raster pixels are placed at…

Katz11
- 1
0
votes
0 answers
Projection issues after rasterize
I am having issues when plotting SST data after rasterizing the original data file. I eventually want to extract SST from a series of points for each day over a period of time, and so I noticed a shift in the raster relative to coastline after I…

villesci
- 5
- 2
0
votes
0 answers
Fixing raster distortion when plotting to PDF
df_clip2_types = left_join(df_clip2, types) %>% na.omit()
fname <- dps[i]
fname1 <- paste0(fname, ".pdf")
pdf(file = fname1)
p_ag_cover <- ggplot() +
geom_raster(data = df_clip2_types, aes(x = x, y = y, fill = cropgroup, group = cropgroup)) +
…
0
votes
1 answer
Overlaying matrix plots
In my experiment each plate has 96 wells, and each well produces 5 colours in different intensities over time. I've worked out how to plot a matrix of time against well for each colour. But I can't work out how to overlay all of the different…

Mike
- 921
- 7
- 26
0
votes
1 answer
Add separate legend for geom_raster and geom_path
I am plotting a raster and overlaying it with two polygons. I want to plot legends for each shapefile separately (i.e., Buffer zones legend and one legend for each polygon). I used show.legend = TRUE inside geom_path but it's not giving me what I…

Ray
- 56
- 1
- 7
0
votes
2 answers
Using geom_raster(), why is it that some tile values(colors) do not appear correctly?
I'm fairly new to R and I'm having some trouble with creating a heatmap using the geom_raster() function. So I am working on the tidytuesday challenge this week and I would like to create a heat map to show if hosting the race poses an advantage to…

Brett Vogelsang
- 11
- 3
0
votes
1 answer
adding points to raster plots with facets
I have a few raster plots separated with facets. In each plot, I want to add an independent point. This shows how to add a point but I can only add the same point to all plots.
Suppose I want to add a point at the maximum value of the following…

quibble
- 303
- 2
- 13
0
votes
0 answers
Auto-fill empty coordinates and smooth data with geom_raster
Code:
ggplot(dat, aes(dat$x, dat$y)) +
xlim(-3,3) +
ylim(-5,5) +
geom_raster(aes(fill = dat$density),
hjust = 0, vjust = 0, interpolate = TRUE, alpha =1)
Data:
x y density
1 -1 1 0.07589831
2 2 1 0.01999884
3 1 0…

wwins
- 13
- 4
0
votes
0 answers
How to represent a data with raster plot and show that some data points are good/bad in R?
I'm working with the data that represents n signals and their values in m different time moments (m ~ 1500, n ~ 50). I came up with the algorithm to check which values are representative for each signal and which are not, so I get n signals and m…

Ian
- 53
- 9
0
votes
0 answers
Is there a way to plot individual components of a group when groups are not exclusive using geom_raster?
I have a time series (albeit small scale i.e., 4 days) dataset that consists of four groups, say, types of granola. Some of the ingredients are shared among the types of granola, so that granola "A" consists of ingredient "x", "y", "c", "f" and…

Scolopax
- 55
- 8
0
votes
1 answer
How to set a constant "ylim" in geom_raster?
I have a kind of "time series", with different measures taken at regular points on the same individuals.
I want to graphically represent 2 of these time series on the same graph (no problem with that), and add a background which depends on a third…

moyneo
- 1
0
votes
1 answer
Changing color ramp in geom_raster to better display outliers
I have a dataset which has a handful of outliers that I'm plotting as a raster in ggplot. Unmodified color schemes tend to highlight these outliers at the expense of showing the distribution of most of the data. Setting limits helps, but values…

James_S
- 19
- 3