How can one change this viridis color platte as shown below to other types of viridis color palette??The code used and the map displayed below is shown for reference:

Changing Viridis to different color palette
252 Views Asked by Prabhakar At
2
There are 2 best solutions below
0
Salix
On
Since the question asked specifically about the viridis color palette, code would be :
library(mapview)
data(franconia)
mapview(franconia,
zcol = "district",
col.region=viridis::viridis_pal(option = "A"))
Where you can change option="A" for "B" or "C" (the current palette used is "D").
For using the other gradients from viridis, you can use
library(mapview)
data(franconia)
mapview(franconia,
zcol = "district",
col.region=viridis::mako(n = 3))
where n must be at least as big as the number of discrete variable or bins. For your gradient, I see you have 6 values on your scale, so I'd put n at 6.
Related Questions in R
- How to make an R Shiny app with big data?
- How do I keep only specific rows based on whether a column has a specific value?
- Likert scale study - ordinal regression model
- Extract a table/matrix from R into Excel with same colors and stle
- How can I solve non-conformable arguments in R netmeta::discomb (Error in B.matrix %*% C.matrix)?
- Can raw means and estimated marginal means be the same ? And when?
- Understanding accumulate function when .dir is set to "backwards"
- Error in if (nrow(peaks) > 0) { : argument is of length zero Calls: CopywriteR ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution ha
- How to increase quality of mathjax output?
- Convert the time intervals to equal hours and fill in the value column
- How to run an R function getpoints() from IPDfromKM package in an R shiny app which in R pops up a plot that utilizes clicks to capture coordinates?
- Replace NA in list of dfs in certain columns and under certain conditions
- R and text on Cyrillic
- The ts() function in R is returning the correct start and frequency but not end value which is 1 and not 179
- TROUBLING with the "DROP_NA" Function
Related Questions in CHOROPLETH
- Making a zip code choropleth in R using ggplot2 and ggmap
- Error: isTRUE(gpclibPermitStatus()) is not TRUE
- R choropleth map of the Dominican Republic
- c("region", "value") %in% colnames(user.df) are not all TRUE
- How to Create a Choropleth or Bubble Map of UK in R
- D3: scale and color for choropleth map
- D3 Choropleth Map
- How does it make the background of that country? (Plotly)
- Choropleth Map Python with Date Slider
- Python px.choropleth mapbox change between variables
- Plotly Choropleth data missing after exporting to html file
- Choropleth Map Using Python
- Leaflet popup graphs don't correspond to map
- Why is my choropleth coming out all the same colour?
- unusual black shapes in d3 choropleth
Related Questions in COLOR-PALETTE
- My Custom Color Palette just won't take - all grey
- Gnuplot: ramdom but deterministic color palette
- Create new customized color palette for a stacked bar chart with R ggplot
- SDL2 1-bit surface, assign one of two colors in palette to a pixel
- Why is my code using the "Paletteer" package generating an error?
- What is GIMP's algorithm for generating an optimum palette for indexed images?
- Setting colour palette based on month in a %b-%Y variable in ggplot2
- WPF Theming and Colours
- How could you prevent this rgb to colorID conversion from creating 256^3 sized arrays and still keep it vectorized?
- Why can I convert an RGB image to a 17 color palette, but no fewer? (Python Pillow version 10.1.0)
- How can I generate colours from images and set it to background of screen
- Pheatmap: mix range and specific value for color
- Use a maximum of 2 colors from a given palette to update a list of any RGB pixels
- Removing border/outline of colour fill for barplot (scale_fill_manual ggplot2)
- Using multiple continuous colour palettes in one graph (ggplot2 and/or ggfortify)
Related Questions in R-MAPVIEW
- R mapview choose color of polygon based on color code in column
- Why is there no output for mapview() command in R 4.2.2 (August 2023)?
- raster and polygons in leaflet, without raster interpolation
- Raster output from rasterized sf points does not align with points
- R: saving a leaflet with white background
- Use If clauses in shiny output depending on the existence of input
- reduce file size of exported leaflet html by linking several layers to the same data (json) instead of keeping the information separately
- mapview: transparent na.color when displaying raster files
- package installation error with 'mapview' package
- Using mapshot() to save mapview(), data layer doesn't show when saving PNG
- R Shiny Leaflet/Mapview map average value on a Choropleth map
- Changing Viridis to different color palette
- Overlay raster RGB and polygon layer in leaflet/mapview with custom CRS in R
- Locking the zoom in on Mapview?
- Display aerial photographs interactively in R
Related Questions in VIRIDIS
- How to get full range of scale_fill_viridis for sankey plot when using factor
- Create a ggplot graph with inferno instead of viridis color palette
- How to skew a color scale?
- Why do viridis and hcl.color yield different colors?
- Identifying colour codes for Viridis Palette - mako option G
- In R Shiny, How do I update a leaflet map colors with a reactive variable?
- ShinyApp - use reactive dataframes to speed up
- Restrict viridis colour scale to between two values
- PNG conversion with viridis color chart error
- How can I specify the color ramp using Scale_color_viridis_c in R?
- violin plots with viridis, removing NAs
- Is there a way to add the viridis color palette to a spplot having these requirements?
- Mapping `int` value to color in a color palette
- echarts4r error at plotting barchart's colors
- Viridis - negative values (correlations) too similar, how color incrementally (any palette R code)?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The
col.regionsoption does that. You can give it a different color palette as an argument:Created on 2022-06-03 by the reprex package (v2.0.1)