powered by
dscale(x, palette, na.value = NA)
with(mtcars, plot(disp, mpg, pch = 20, cex = 3, col = dscale(factor(cyl), brewer_pal())))
Run the code above in your browser using DataLab