Module # 9 assignment
Issaiah Jennings
Module # 9 assignment
Multivariable visualization effectively displays multiple relationships in a single plot without overcrowding. Color helps differentiate categorical variables like cylinders, while size encoding adds another dimension by representing weight. However, size differences can sometimes be misleading, and too many categories may make color distinctions harder to interpret. Labels and legends are kept simple to enhance clarity, while minimal styling (theme_minimal()) reduces distractions. Accuracy is maintained by properly scaling size and color, ensuring the data isn’t misleading. Aesthetic choices, like distinct colors and transparency, improve readability, and the scatter plot format keeps the visualization functional without overwhelming the viewer.
> # Load necessary libraries
> library(ggplot2)
>
> # Create a multivariate scatter plot
> ggplot(mtcars, aes(x = hp, y = mpg, color = as.factor(cyl), size = wt)) +
+ geom_point(alpha = 0.7) +
+ scale_color_manual(values = c("red", "blue", "yellow")) +
+ labs(title = "Multivariate Analysis of mtcars Dataset",
+ x = "Horsepower (hp)",
+ y = "Miles per Gallon (mpg)",
+ color = "Cylinders",
+ size = "Weight (1000 lbs)") +
+ theme_minimal()

Comments
Post a Comment