An R package implementing several popular color maps, such as the 'viridis' (the default) 'magma', 'plasma', 'inferno', and 'cividis' in R. These color maps are designed to be perfectly perceptually-uniform, both in regular form and also when converted to black-and-white. They are also designed to be perceived by readers with the most common form of color blindness (all color maps in this package) and color vision deficiency ('cividis' only).
Questions tagged [viridis]
61 questions
0
votes
0 answers
Why are the darkest color of the viridis and plasma colormaps not black?
A few years back I dug into the world of colormaps and was thrilled when the viridis, magma, plasma, inferno and cividis colormaps were created. But the fact that the darkest colors in viridis and plasma (and to a lesser extent cividis) are not…

Fredrik P
- 682
- 1
- 8
- 21
0
votes
2 answers
ggplot: Modify histogram plot
I made this plot using the following code:
ggplot(all, aes(x = year, color = layer)) +
geom_histogram(binwidth = 0.5, fill = "white", alpha = 0.5, position = "dodge") +
scale_x_continuous(breaks = pretty(all$year)) +
scale_color_discrete(name…
user13686580
0
votes
1 answer
Obtaining line graphs with multiple colours for groups with continuous data in R
I am trying to obtain all the daily demand curves with a minimum demand of < 400. The data comprises for a whole one year. I want the curves to be grouped by month. Following is my…

Rhythm
- 13
- 3
0
votes
1 answer
How to change the color scale in ggplot plots
I am trying to plot a simple bar.plot where heat.colors reflect increasing (red) or decreasing (blue or yellow) trends (through time in this case).
For example,
set.seed(1)
estimates<-sample(1:100, 30, replace=FALSE) #this estimates are not…

user3660245
- 123
- 1
- 7
0
votes
0 answers
How to change middle value in a color index?
I want to reproduce the following plot from here:
plot with cm.colors(255):
ImagePlot <- function(x, ...){
min <- min(x)
max <- max(x)
layout(matrix(data=c(1,2), nrow=1, ncol=2), widths=c(1,7), heights=c(1,1))
ColorLevels <- cm.colors(255)
…

dikip
- 43
- 6
0
votes
0 answers
generate very different colors [R] from unique categories
Currently I have a data.table with a column named brand, where brand is a character column.
I am using the following code to generate a color for each brand:
Library(viridis)
color.list <- df[, .(
brand = sort(unique(brand)),
brand.color =…

Oliver
- 443
- 4
- 10
0
votes
1 answer
R ggplot graph color gradient same for two different plots
Hello I am ploting two graph using ggplot for two different data sent and using viridis colour gradient. because of data two graph colour gradient are different so I wanted make it same can any one suggest…

Hemantchandru naik
- 101
- 7
0
votes
1 answer
R ggplot viridis change the color gradient
Hello I am plotting scatter plot using R ggplot for coloring using virdis, I wanted split the color legend to get more contrast between ranges currently legend having 1000,2000,3000,4000 In between this split this to get more color currently my code…

Hemantchandru naik
- 101
- 7
0
votes
0 answers
Extent Viridis color scheme
Is there a way i could extent (prepend) the value 'transparent' at the start of the Viridis colour scheme? Or maybe to overrule it in a way that every value (let's say) below -30 is the 'colour' transparent?
plot.nme =…

Mark Henry
- 2,649
- 7
- 40
- 48
0
votes
1 answer
Choosing two colors from palette in scatter plot
I am trying to make scatter plot in python using viridis palette with only two values. I really like the purple, but the yellow is bearly visible. is it possible to choose middle value (blue) and purple?
x_test = [1, 2, 3, 4]
y_test = [1, 2, 3,…

AAAA
- 461
- 6
- 22
0
votes
0 answers
Coloring stacked area in highcharts in R
I wish to color the entire area of the graph in different colors using the highcharter package in R.
The below code is merely highlighting the dots in the graph not the entire area as illustrated in the picture below
The data used here is the…

Manasi
- 179
- 1
- 8
0
votes
0 answers
How to match geom_ribbon fill to geom_line color (using ggplot2)?
I am trying to create a line plot for two continuous variables (xy) with shading for the confidence interval, but with custom and matched colors for the line and the shading. GGplot correctly takes (discrete) colors from the viridis scale for the…

Ishisht
- 33
- 1
- 8
0
votes
1 answer
ggplot2 produces two legends instead of one
I am trying to do a simple logged ggplot, showing the change in tree and shrub density over time (site age). the tree species are split into native / exotic.
I have also downloaded the viridis package, to enable a type of coloration to the…

Katherine De Silva
- 37
- 1
- 2
0
votes
1 answer
getting discreet variables to always plot in the same color with viridis and ggplot
I am making multiple plots, that contain the same 4 discrete values, unknown, Negative, Neutral, Positive.
However not all of the data sets contain all the discrete values, and as such
in plot 1, unknown = yellow
in plot 2, unknown =…

Pythonuser
- 203
- 1
- 11
0
votes
1 answer
Can viridis be diverged from a midpoint where geom_contour (breaks=1) occurs?
I have been trying to figure out if I can diverge viridis from the black line, geom_contour(breaks = 5E-14).
In essence, the black line is the midpoint and viridis palette would diverge there. Is this possible?
Thank you!
Design.matrix <-…
user3073118