r - Index table beside plot -


i looking way add table beside plot (outside of actual cartesian canvas). table index of sort more information correlating labels on plot. have scatter plot follows created using ggplot:

enter image description here

the r code plot follows:

png("image.png", width = 2000, height = 1500, res = 85); ggplotxy <- ggplot(scatterplotdata, aes(x=x, y=y, colour=labels, label=labels)) + geom_point() + geom_text(hjust=0, vjust=0) ggplotxy dev.off() 

i have column in data frame has name of point. so, example, long these lines:

1: name 1 2: name 2 3: name 3 . . . 150: name 150 

how go adding such table? don't want add whole name in scatter plot overlap lot of points. can see, numbers overlap although it's acceptable.

an inputs welcome , appreciated.

try minimal example:

library(gridextra) library(ggplot2) grid.arrange(qplot(1,1), legend = tablegrob(matrix(1:10, ncol=2))) 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -