VISUAL 1: Harry Potter Spells When They Were Used https://flowingdata.com/2016/10/12/all-the-harry-potter-spells-when-they-were-used/
Pros: -Visually pleasing -Labeling the books with colors to distinctly show which book was a smart choice. -Having the Names of the spells on the left written horizontally makes it easy to read. -Can sort by order or appearance and most used! Essentially looking at two graphs with this! How neat! -When you hover over each point, it references the spell in the book. This probably took so much time but it is uber cool.
Cons: -The bottom is a scale from 100K to 1300K and it is titled word position. This is a little confusing to interpret. If it said something like position of spell among words in book or something along those lines it might make it more clear. -Have to scroll to see the whole plot. It would be nice if it was all laid out. -The colors could have been placed to the right maybe. Its clear that its a timeline, but the blue from the first book isn’t centered over the blue points which is confusing as the rest of the points are.
VISUAL 2: Demographics for Immigrants from Banned Countries https://flowingdata.com/2017/02/02/demographics-for-immigrants-from-banned-countries/
Pros: -Clean, precise graph with clear labels on x and y axis -The message is clear that immigrants, especially Iraqi and Libyan immigrants, hold a college degree, which is higher than the US average in some cases. -If you follow the link to the NY Times link, you learn the whole story with the other plots and visuals given: https://www.nytimes.com/interactive/2017/01/30/us/politics/trump-immigration-ban-demographics.html?_r=0 -No use of unnecessary colors, shapes, or effects which strengthens the arguement in my opinion
Cons: -Might be nice to label U.S. average at the bottom with numbers -I think they should make it clear that they are looking at immigrants versus the U.S. population as a whole including the immigrants. At first I thought it was immigrants from these countries vs. U.S. citizens, but after going to the NY Times link I discovered I was wrong
#USING R
#I CHOSE TO USE 10 BREAKS BECAUSE I FELT IT MORE BINS PROVIDED A BETTER PICTURE
x <- mtcars$mpg
hist(x, breaks=10, xlab="Miles Per Gallon", xlim=c(0,40), main="Histogram of Miles Per Gallon")
#USING GGPLOT
require(ggplot2)
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.3.2
ggplot(data=mtcars, aes(x=mpg))+geom_histogram(bins=20)+ylab("Number of Cars") + xlab("MPG") + ggtitle("Miles per gallon") + xlim(0,40)
plot(mtcars$wt, mtcars$mpg, main="Scatterplot of Weight vs. MPG",
xlab="Car Weight ", ylab="Miles Per Gallon ", pch=19)
ggplot(mtcars, aes(wt, mpg)) + geom_point() + ylab("Weight") + xlab("Miles Per Gallon") + ggtitle("Scatterplot of Miles Per Gallon")
#PLOT 1
ggplot(aes(y = mpg, x = factor(am), fill=factor(am)), data = mtcars) + geom_violin() + ggtitle("Miles per Gallon (MPG) by Transmission") + xlab("Transmission") + ylab("Miles per Gallon (MPG") + scale_fill_discrete(name="Type", breaks=c("0", "1"),labels=c("Automatic","Manual")) + theme(axis.title.x=element_blank(),
axis.text.x=element_blank(),
axis.ticks.x=element_blank())
#PLOT 2
ggplot(data=diamonds,aes(x=carat,y=price))+geom_point()+
facet_wrap(~cut)+geom_smooth()
## `geom_smooth()` using method = 'gam'