Skip to content

Instantly share code, notes, and snippets.

@soonraah
Created January 5, 2014 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soonraah/8265041 to your computer and use it in GitHub Desktop.
Save soonraah/8265041 to your computer and use it in GitHub Desktop.
散布図で各点の色を指定する方法
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