I'm using the glmtools
library for my master thesis, however, the default color palette is not aesthetically pleasing. There is not an argument about the color palette in the glmtools::plot_temp
help, only says that other arguments are passed to par()
. I've tried without success to change the palette. Any help?
To install glmtools
devtools
devtools
devtools::install_github("GLEON/GLMr")
devtools::install_github("USGS-R/glmtools")
library(glmtools)
The default example is:
sim_folder <- run_example_sim(verbose = FALSE)
nc_file <- file.path(sim_folder, 'output.nc')
plot_temp(file = nc_file, fig_path = FALSE)
plot_temp(file = nc_file, fig_path = 'test_figure.png', height = 3, reference = 'surface')
And the horrible result is:
I'd like to use the palette terrain.colors
or heat.colors
With glmtools
, we had some internal functionality to pass through alternative palettes, but didn't have it exposed in the plot functions yet. Check out the latest version on github (0.14.8) . From plot_var
, which you can use to plot temperature, you can pass in your own palette function. This should work with any variable you are plotting in heatmap form through glmtools
package.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.