Taller 2

library(ggplot2)

ggplot(iris, aes(x = Sepal.Length, y = Petal.Length, color = Species)) +
  geom_point(size = 3) +
  labs(
    title = "Relación entre largo de sépalo y pétalo",
    x = "Largo del sépalo",
    y = "Largo del pétalo",
    color = "Especie"
  ) +
  theme_minimal() +
  theme(
    text = element_text(family = "mono"),  
    plot.title = element_text(size = 14, face = "bold")
  )

ggplot(iris, aes(x = Species, y = Sepal.Width, fill = Species)) +
  geom_boxplot() +
  labs(
    title = "Distribución del ancho del sépalo por especie",
    x = "Especie",
    y = "Ancho del sépalo"
  ) +
  theme_light() +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold")
  )

ggplot(mtcars, aes(x = factor(cyl), fill = factor(cyl))) +
  geom_bar() +
  labs(
    title = "Cantidad de autos por número de cilindros",
    x = "Número de cilindros",
    y = "Cantidad",
    fill = "Cilindros"
  ) +
  theme_classic() +
  theme(
    plot.title = element_text(hjust = 0.5, face = "bold")
  )

ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_line(color = "blue") +
  labs(
    title = "Relación entre peso y rendimiento de combustible",
    x = "Peso del vehículo",
    y = "Millas por galón"
  ) +
  theme_bw() +
  theme(
    text = element_text(family = "mono"),  
    plot.title = element_text(size = 14, face = "bold")
  )