Skip to content

Instantly share code, notes, and snippets.

@juanchiem
Last active March 18, 2021 17:05
Show Gist options
  • Save juanchiem/5c8bf3d994312cfdddc6bb10ffb244ac to your computer and use it in GitHub Desktop.
Save juanchiem/5c8bf3d994312cfdddc6bb10ffb244ac to your computer and use it in GitHub Desktop.
library(tidyverse)
library(ggforce)
tibble::tribble(
~patogeno, ~hum_min, ~hum_max, ~temp_min, ~temp_max,
"RE",3L,6L,8L,14L,
"RH",6L,10L,18L,25L,
"RT",8L,12L,20L,30L,
"MA",28L,32L,18L,28L,
"SEP",72L,96L,10L,15L) %>%
mutate(hum = (hum_min+hum_max)/2,
temp = (temp_min+temp_max)/2,
a =temp_max - temp_min,
b = hum_max - hum_min,
color = case_when(
str_detect(patogeno, "roya") ~ "red",
TRUE ~ "blue")) %>%
ggplot(aes(x0 = temp, y0 = hum,
a = a/2, b = b, angle = 0)) +
geom_ellipse() +
geom_text(aes(x = temp, y=hum, label=patogeno), fontface="bold")+
cowplot::theme_minimal_grid() +
labs(x = "Temperatura (°C)", y = "Humedad (horas de mojado)")+
guides(col = F)
ggsave(file = "~/Dropbox/4_Eventos/extension/seminario_virtual_fina/foliares2.png",
# type = "cairo-png",
bg = "transparent",
width = 6, height = 5, dpi = 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment