library(ggplot2)
library(RColorBrewer)
data(iris2D)
ggplot(data = iris2D, aes(x = iris2D[,1], y = iris2D[,2], color = iris2D[,3])) +
geom_point(stroke = 0.5) +
xlim(min(iris2D[,1]), max(iris2D[,1])) +
ylim(min(iris2D[,2]), max(iris2D[,2])) +
xlab(names(iris2D)[1]) +
ylab(names(iris2D)[2]) +
labs(color='Species') +
scale_color_manual(values = brewer.pal(3, "Dark2")) +
theme(panel.border = element_rect(colour = "black", fill=NA),
aspect.ratio = 1,
axis.text = element_text(colour = 1, size = 12),
legend.background = element_blank(),
legend.box.background = element_rect(colour = "black"))
Run the code above in your browser using DataLab