Skip to content

Commit

Permalink
Add heatmap to main text figure panel
Browse files Browse the repository at this point in the history
  • Loading branch information
emmamendelsohn committed Jul 28, 2020
1 parent afbc251 commit eaa0250
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Binary file modified figures/drug-bacteria-barchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/drug-bacteria-heatmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions scripts/figure-dev/data_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ heatmap <- ggplot(heatmap_mat %>%
mutate(drug = fct_rev(drug)),
aes(bacteria, drug)) +
geom_tile(color = "black", aes(fill = n), alpha = 0.5) +
geom_text(aes(label = n), color = "black", size = 7) +
geom_text(aes(label = n), color = "black", size = 5) +
scale_fill_viridis_c(guide = FALSE, alpha = 0.5, na.value="transparent") +
scale_x_discrete(position = "top", expand = c(0, 0)) +
scale_y_discrete(expand = c(0, 0)) +
Expand Down Expand Up @@ -127,9 +127,11 @@ bact_total <- top_bact %>%
axis.ticks = element_blank())
ggsave(here("figures/bacteria-barchart.png"), width = 12, height = 9)

plot_grid(drugs_total, NULL, bact_total, nrow = 1,
top_row <- plot_grid(drugs_total, NULL, bact_total, nrow = 1,
rel_widths = c(1, 0.05, 1), labels = c('A', '', 'B'), label_size = 12)
ggsave(here("figures/drug-bacteria-barchart.png"), width = 14, height = 7)
bottom_row <- plot_grid(heatmap, labels = 'C', label_size = 12)
plot_grid(top_row, bottom_row, nrow = 2)
ggsave(here("figures/drug-bacteria-barchart.png"), width = 19.5, height = 12)

# Publications over time --------------------------------------------------
events %>%
Expand Down

0 comments on commit eaa0250

Please sign in to comment.