Last active
August 29, 2015 14:23
-
-
Save euclidjda/ae565ce79cbff4501bbb to your computer and use it in GitHub Desktop.
Plotting class densities example for machine learning classification - example #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ggplot2) | |
| library(mlbench) | |
| data(PimaIndiansDiabetes) | |
| p <- ggplot( PimaIndiansDiabetes, | |
| aes( x=glucose, fill=diabetes))+ | |
| geom_histogram(alpha=0.4,position="identity")+ | |
| xlab("diabetes")+ | |
| scale_y_continuous("Number of Observations") | |
| p + guides(fill=guide_legend(title=NULL)) + | |
| scale_fill_discrete(labels=c("Diabetes Negative","Diabetes Positive")) + | |
| theme(legend.position=c(1,1),legend.justification=c(1,1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment