Created
January 5, 2014 06:13
-
-
Save soonraah/8265041 to your computer and use it in GitHub Desktop.
散布図で各点の色を指定する方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
# CSV 読み込み | |
color_plot_data <- read.csv("points.csv") | |
# 座標データとして x, y 列、色データとして r, g, b 列を与えて散布図を描画 | |
ggplot(data=color_plot_data, aes(x=x, y=y, col=rgb(r, g, b))) + | |
geom_point() + | |
scale_color_identity() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment