-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlay data table in plot #36
Comments
Could use paste to make a new var that combines date, min, max and a line break |
Example (can likely be done much more elegantly)
|
I know it's been a while, but one option is to use library(ggplot2)
library(dplyr)
library(patchwork)
counts <- count(mtcars, cyl)
counts
# cyl n
# 1 4 11
# 2 6 7
# 3 8 14
tab <- gridExtra::tableGrob(counts, rows = rep("", nrow(counts)))
gg <- ggplot(mtcars, aes(mpg, disp)) + geom_point() With that setup, we can do gg + inset_element(tab, left = 0.7, bottom = 0.7, right = 1, top = 1) gg + tab + plot_layout(widths = c(4, 1)) There are many theming options for the table, such as font, color ( (This is applicable to #39 as well.) |
Hi everyone
I'm plotting a weekly temperature data series (values every 10 minutes) and would like to overlay a table with daily max/min temperature in my plot. Max/min temp are in a dedicated data.frame object. Is it possible to use geom_richtext in this case?
Thanks in advance
The text was updated successfully, but these errors were encountered: