Gradient colour scales

Published by onesixx on

https://ggplot2.tidyverse.org/reference/scale_gradient.html
  • scale_*_gradient  : 2 가지 colour gradient (low-high)
  • scale_*_gradient2 : 3가지 colour gradient (low-mid-high)
  • scale_*_gradientn : n가지 colour gradient.

* color, fill => scale_ color _gradient , scale_ fill_gradient

scale_colour_gradient(...,
  low = "#132B43",                       # muted("red")   "white"   "#56B1F7"   "grey50" 
  high = "#56B1F7",
  space = "Lab",
  na.value = "grey50",
  guide = "colourbar",
  aesthetics = "colour"                  # "colour"  "fill" 
)
scale_colour_gradient(...,
  low = "#132B43",                       muted("red")   "white"   "#56B1F7"   "grey50" 
  high = "#56B1F7",
  space = "Lab",
  na.value = "grey50",
  guide = "colourbar",
  aesthetics = "colour"                   "colour"  "fill" 
)

Other colour scales:
 scale_alpha,
 scale_colour_brewer,
 scale_colour_grey
,scale_colour_hue,
 scale_colour_viridis_d

Categories: ggplot2

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x