# What is this distribution?

This is a plot of temperature against wind speed using R's weather data (nycflights13 package). The question asks what is the distribution of temperature as a function of windspeed? Honestly, I don't see any distribution. • One reason you cannot see a distribution is that this plot isn't able to show it correctly due to the extensive overplotting of points. Use a visualization that enables you to see the actual bivariate distribution the data (jitter the points, use transparency, make hex plots, use sunflowers, etc). – whuber Oct 26 '19 at 14:10

First, the data you are using is an hourly time series covering one complete year (2013). So in your plot there is a lot of overplotting, which hides structure. One way of avoiding it is Code for this plot:

library(ggplot2)
ggplot(weather, aes(x=wind_speed, y=temp)) + geom_hex() +xlim(0, 50) +xlab("wind_speed (mph)")+ylab("temp (F)")


But this is still hiding a lot of variation, we would expect both monthly variation, and hourly variation (and time series correlations we do not go into.)

EDIT


Faceting first by month, then by hours, separately:  Then this graphical investigation can continue in this way ... Below is a plot from an earlier version, kept for documentation. Wasn't a very good idea:

One try is to show hourly variation by color and monthly by faceting: It is clearly a lot of seasonal variation, while it is not easy from this plot to understand the hourly variation, at least not for me. Maybe there are better ideas. Code for this plot:

mypal <- RColorBrewer::brewer.pal(6, "Greens")
mypal <- c(mypal,  rev(mypal))

ggplot(weather, aes(x=wind_speed, y=temp,  col=hour)) + geom_jitter() +xlim(0, 50)+ facet_wrap(~ month)+scale_color_gradientn(colors=mypal)+xlab("wind_speed (mph)")+ylab("temp (F)")

• I don't understand the value in the last plot of coloring according to hour: that destroys the virtue of the first plot, which is to show relative counts and thereby reveal the bivariate distribution of speed and temperature. To carry out the program you hint at, begin by faceting the original hex plot by month. – whuber Oct 27 '19 at 14:38
• Agreed, wasn't a very good idea. Edited. – kjetil b halvorsen Nov 2 '19 at 21:26
• Upvoted for the clarity and excellence of the (edited) answer. – James Phillips Nov 2 '19 at 22:11