Write code and compare this visualization with the original overcrowded scatter plot.
Explain how faceting improves readability.
Faceting separates classes into different plots reducing overlaping from different classes
Identify patterns or relationships that are easier to recognize in the faceted version.
Its easier to see that vehicles with larger engines have lower MPG. The gaps in MPG between vehicles is also clear. ## Part 3: Improve the Visualization Using facet_grid()
Create another visualization using facet_grid().
Use vehicle class as rows and drive type (drv) as columns.
Write code and examine how the visualization is organized.
Explain how facet_grid() differs from facet_wrap().
facet_grid() organizes data using two categorical variables
facet_wrap() separates data using one categorical variable and arranges panels across multiple rows and columns
Discuss whether organizing the data by two categorical variables provides additional insights.
It does. It allows us to examine whether the relationship between engine displacement and highway MPG differs depending on vehicle class. It also reveals which combinations of vehicle class and drive type are represented in the dataset.
Part 4: Critical Thinking and Comparison
Answer the following questions:
What makes the original scatter plot overcrowded or difficult to interpret?
Several vehicles represented by different vehicles, making it hard to identify vehicles and recognize patterns with each classes of vehicles.
How does facet_wrap() help address the problem?
facet_wrap() separates each vehicle class into its own panel. This reduces overlapping points from different classes and makes it easier to compare patterns in engine displacement and highway MPG.
What additional information does facet_grid() provide?
facet_grid() Allows us to compare two categorical variables simultaneously. By organizing vehicle classes into rows and drive types into columns, we can examine how both factors relate to highway MPG.
Which of the three visualizations would you recommend for communicating the relationship between engine displacement and highway MPG? Justify your answer.
Honestly, I would use an interactive scatterplot because as useful as the facet_wrap() and facet_grid() are, I think it’s easier to toggle between classes, and it saves way more time coding when you have an interactive chart.
Are there any disadvantages to using too many facets?
Yes, using too many facets can make individual panels too small and difficult to read. It can also make comparisons harder because the viewer has to examine many separate paragraphs. Also, in some of my facets, some of the dots are still clustered close, even worse than the one we had at the scatterplot.