0% found this document useful (0 votes)
37 views

Play Around With The Colorramppalette Function. Try The Following Simple Plot

This document discusses using the colorRampPalette() function in R to create color palettes for plotting. It provides an example of using colorRampPalette() with 100 colors from red to yellow to blue to color points in a simple plot based on random normal data. It then asks what would happen if only 10 colors were used instead of 100.

Uploaded by

infweb4735
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Play Around With The Colorramppalette Function. Try The Following Simple Plot

This document discusses using the colorRampPalette() function in R to create color palettes for plotting. It provides an example of using colorRampPalette() with 100 colors from red to yellow to blue to color points in a simple plot based on random normal data. It then asks what would happen if only 10 colors were used instead of 100.

Uploaded by

infweb4735
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Play around with the colorRampPalette() function.

Try the following simple plot:


pal <- colorRampPalette(c("red", "yellow", "blue")) x <- rnorm(100) plot(x, col = pal(100))

What happens if you just use 10 colors (i.e. pal(10)) instead of 100?

You might also like