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 looking as below
library(dplyr)
library(ggplot2)
library("viridis")
df <- tibble(gene = sample.int(5000),aceth = rnorm(5000),acvitd = rnorm(5000))
df$log_mean=log(df$gene)
p=ggplot(df, aes(aceth, acvitd))+
geom_point(aes(color =gene)) +
theme(legend.position = "top")+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
panel.background = element_blank(), axis.line = element_line(colour = "black"))
p=p+ theme(legend.position = "top") +
scale_color_viridis(option = "A",
name = "mean",
guide = guide_colourbar(direction = "horizontal",
barheight = unit(4, units = "mm"),
barwidth = unit(100, units = "mm"),
draw.ulim = F,
title.hjust = 0.5,
label.hjust = 0.5, title.position = "top"))
How I wanted my graph look like
can anyone suggest me