-3

I want to reproduce a graph as shown in the image I uploaded. The second image is a screenshot of my excel file. I want to make a scatter plot on the basis of species as shown in the figure. I have six different species: Mouse, maca, human, orangutan, gorilla and chimp. I have more than 1700 observations in my dataset. I tried using both qpplot and simple plot function but that didn't help me reproduce the figure. I then tried creating a subset such that I get first 23 observations for each specie in dataframe and plot those dataframes using the simple plot function. Any suggestions how I can reproduce the graph.

The Figure I want to reproduce

Image of my dataset

Heroka
  • 12,889
  • 1
  • 28
  • 38
Jane Dow
  • 113
  • 4
  • Welcome to SO. Please consider reading up on [ask] and how to produce a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Heroka Nov 13 '16 at 14:04

1 Answers1

1

I think this example is similar to the figure

library(ggplot2)
data(mtcars)

mtcars$cyl <- as.factor(mtcars$cyl)

# Extend the regression lines
ggplot(mtcars, aes(x=wt, y=mpg, color=cyl, shape=cyl)) +
geom_point() + 
geom_smooth(method=lm, se=FALSE, fullrange=TRUE)

The code is from http://www.sthda.com/english/wiki/ggplot2-scatter-plots-quick-start-guide-r-software-and-data-visualization

JKim
  • 135
  • 2
  • 7