Swarchal / platetools

An R package for plotting microtitre plates
Other
54 stars 15 forks source link

feature_request #4

Closed dumont-s closed 6 years ago

dumont-s commented 6 years ago

Hi, I'm interested to use raw_map but with rainbow colors rather than blue gradient. Is it possible to do this easily? Thanks

Swarchal commented 6 years ago

Hi, yes you can pass any colour scheme you want via the normal ggplot2 functions.

Quick example using scale_fill_gradientn()


library(platetools)
library(ggplot2)

df <- data.frame("well" = num_to_well(1:384, plate=384),
                 "value" = runif(384, 1, 100))

rainbow_colours <- colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan","#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000"))

raw_map(df$value, df$well,
        plate = 384) +
    scale_fill_gradientn(colors = rainbow_colours(7))

image