p1 <- airquality |>ggplot(aes(x=Temp, fill=Month)) +geom_histogram(position="identity")+scale_fill_discrete(name ="Month", labels =c("May", "June","July", "August", "September")) +labs(x ="Monthly Temperatures from May - Sept", y ="Frequency of Temps",title ="Histogram of Monthly Temperatures from May - Sept, 1973",caption ="New York State Department of Conservation and the National Weather Service") #provide the data source
Plot 1 Output
p1
`stat_bin()` using `bins = 30`. Pick better value `binwidth`.
Plot 2: Improve the histogram of Average Temperature by Month
p2 <- airquality |>ggplot(aes(x=Temp, fill=Month)) +geom_histogram(position="identity", alpha=0.5, binwidth =5, color ="white")+scale_fill_discrete(name ="Month", labels =c("May", "June","July", "August", "September")) +labs(x ="Monthly Temperatures from May - Sept", y ="Frequency of Temps",title ="Histogram of Monthly Temperatures from May - Sept, 1973",caption ="New York State Department of Conservation and the National Weather Service")
Plot 2 Output
p2
Plot 3
p3 <- airquality |>ggplot(aes(Month, Temp, fill = Month)) +labs(x ="Months from May through September", y ="Temperatures", title ="Side-by-Side Boxplot of Monthly Temperatures",caption ="New York State Department of Conservation and the National Weather Service") +geom_boxplot() +scale_fill_discrete(name ="Month", labels =c("May", "June","July", "August", "September"))
Plot 3 Output
p3
Plot 4: Side by Side Boxplots in Gray Scale
p4 <- airquality |>ggplot(aes(Month, Temp, fill = Month)) +labs(x ="Monthly Temperatures", y ="Temperatures", title ="Side-by-Side Boxplot of Monthly Temperatures",caption ="New York State Department of Conservation and the National Weather Service") +geom_boxplot()+scale_fill_grey(name ="Month", labels =c("May", "June","July", "August", "September"))
Plot 4 Output
p4
Plot 5:
p5 <- airquality |>ggplot(aes(x= ,4, fill = Month))+geom_histogram(position ="identity", alpha=.4, binwidth=5, color="green")+scale_fill_discrete(name="Month", labels=c("May", "June","July", "August", "September")) +labs(x ="Monthly Wind from May - Sept", y ="Frequency of Wind Intensity", title ="Histogram of Monthly Wind Intensity from May - Sept, 1973",caption ="New York State Department of Conservation and the National Weather Service")
Plot 5 Output
p5
Essay
I created an overlapping histogram to visualize monthly wind intensity from May through September. A histogram is useful for showing the distribution and frequency of data, which displays how wind speeds are spread across different months. In this plot, each month’s wind data is layered on the same axes, making it easy to see similarities and differences in their distributions. The graph indicates that wind intensity is fairly consistent across most months, with similar frequency patterns and ranges. However, July appears to have slightly higher wind values compared to the others, suggesting it may experience mildly stronger winds during that period. Other than July, I don’t think the graph shows any intense insights for wind intensity. To improve clarity, I used the “alpha” parameter to make the histogram bars partially transparent. This transparency allows overlapping bars from different months to be visible at the same time, making comparisons easier. I also used different colors and a legend to clearly distinguish each month’s data.