Questions tagged [metr]
8 questions
3
votes
1 answer
Labeling contour lines in R using metR with gratia or ggplot2
Some ways to add labels on contour plots
# load packages
library('mgcv')
library('gratia') # draw(); smooth_estimates()
library('metR') # geom_contour2(); geom_text_contour()
library('ggplot2')
Simulate data using the example from Gavin Simpson's…

denis
- 199
- 1
- 8
2
votes
1 answer
nullGrob error on plotting in ggplot2 / metR
I am plotting (using ggplot2) a series of 3D data as a 2D surface plot with a colour scale for the vertical axis. I'm also plotting contours and contour labels (using metR).
I've come across some data that makes the plot fail with the error Error…

masher
- 3,814
- 4
- 31
- 35
1
vote
1 answer
In ggplot2 with polar coordinates connect points with geom_path across 0/2*pi with unequally spaced data
I have a very similar question to this question from 2014. However, the solution to that question doesn't work in my case, as I can't convert my angular coordinate data to a factor, as they are not equally spaced.
The case I'm considering is a track…

climatestudent
- 459
- 4
- 13
1
vote
1 answer
The command geom_contour_fill fails to render in some cases in ggplot2
This is my first question so doing my best to make my question simple and reproducible.
I'm running into a problem with the R command geom_contour_fill from the metR library. The code below shows that geom_contour_fill fails to plot in some cases…

Kevin Thuot
- 66
- 5
0
votes
0 answers
R metR::ReadNetCDF for input file with "years" as time unit
While it is not consistent with the Unidata conventions and recommendations, some netcdf files have a time variable with units of the form "years since {some_date}". An
Example file was obtained from the KNMI Climate Explorer. With the R package…

climatestudent
- 459
- 4
- 13
0
votes
0 answers
Is there a way of creating own color scheme or bins for geom_contour_fill from metR package?
I am getting this contour plot, but I need the values <-1.5 to be distinct from >-1.5 because it makes a difference in identifying which are the years of interest. However, since values like -1.54 and -1.4 are so close to each other, the contour map…

Mustafa
- 1
0
votes
1 answer
Why does ggplot scale_colour_manual na.value parameter not work?
I ran in trouble while using scale_colour_manual's na.value parameter. It simply does nothing. I use the following code to generate a filled contour plot.
p1<-ggplot(wc_results_daily, aes(date_day, depth_num, z=daily_mean)) +
…

krisldisl
- 1
- 3