# >
Plotting distributions: histograms
- Using the
mtcars
data, create a histogram of the fuel efficiency values.
- Not a great histogram. Mess with the number of bins until you get a nice histogram.
# >
- Now change the bin width to generate the same plot as #2.
# >
- Using the same binwidth from #3, plot a histogram with lightseagreen lines and aquamarine3 shaded areas. Then overlay a density plot with a aquamarine4 line with width 2.
# >
What is the difference between a frequency polygon and a density plot?
Make a density plot with bandwidth of 3 and separate line colors for different cylinder levels.
# >
- Repeat #6 but also include separate colors for the shaded areas with a transparency of 0.5. Use viridis colors for both lines and shaded areas, and reverse the direction of the colors where 4 is yellow, 6 is greenish, and 8 is purplish.
# >