assignment 8

Row

Chart 1

Row

Chart 3

ggplot(tx_m_plot, aes(x=month)) + 
  geom_line(aes(y=tavg, color="temp")) +
  geom_line(aes(y=Homicide*50, color="Homicide"))

Chart 4

temperatureColor <- "#69b3a2"
priceColor <- rgb(0.2, 0.6, 0.9, 1)

ggplot(tx_w_plot, aes(x=Year)) + 
  geom_line(aes(y=tmax, color="Max Temperature")) +
  geom_line(aes(y=Homicide*150, color="Homicide")) +
  scale_y_continuous(
    name = "Temperature",
    sec.axis = sec_axis(~./150, name="Crime Count")
  ) + 
  theme_ipsum() +
  theme(
    axis.title.y = element_text(color = temperatureColor, size=13),
    axis.title.y.right = element_text(color = priceColor, size=13),
    legend.box.margin = margin(116, 6, 6, 6),
    legend.key = element_rect(fill = "white", colour = "black"),
    legend.title = element_blank(),
    text = element_text(family = "serif"),
    plot.title = element_blank()
  ) +
  #ggtitle("Crime against Temp, Annual Averages") + 
  guides(shape=FALSE)
Warning: The `<scale>` argument of `guides()` cannot be `FALSE`. Use "none" instead as
of ggplot2 3.3.4.
Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
not found in Windows font database
Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
not found in Windows font database
Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family not found in Windows font database
Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family not found in Windows font database
Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
font family not found in Windows font database
Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
font family not found in Windows font database
Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
font family not found in Windows font database
Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
font family not found in Windows font database
Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
font family not found in Windows font database