'''
my_data<-iris
''' '''
length.ratio<- my_data$Sepal.Length/my_data$Petal.Length
width_ratio<-my_data$Sepal.Width/my_data$Petal.Width
''' '''
my_data$Species<-as.factor(my_data$Species)
''' #Attempt of plotting with ggplot2
'''
ggplot(my_data,aes(length_ratio,fill=Species))+theme_bw()+
facet_wrap(width.ratio~Species)+ geom_density(alpha=0.5)+
labs(x="Width Ratio", y="Length Ratio")
'''
#Actually, I neither know which 'geom_plot' is the best option.
It looks like you are looking for a scatter plot. So try this and always try to keep your variables in your dataframe. If you store your variables inside same dataframe you do not have to create a new factor. Here the code:
The plot:
Output:
And if you want to study density try this:
Output: