1

I would like to create a bar plot with a table right underneath that is, kind of, part of the x-axis: See the mock-up of the desired graph below and please ignore the geom_point and errorbars:

enter image description here

In the table I want to show additional variables related to the x-axis data. The dataframe looks something like this:

device_name <- c("device1", "device2", "device3")
performance <- c(0, 3.5, 6)
modification1 <- c("Yes", "No", "Yes")
modification2 <- c("No", "Yes", "Yes")
df <- data.frame(device_name, performance, modification1, modification2)

Is there a way to do this without manual formatting the table position and column width so it fits to the bar chart axis?

KoenV
  • 4,113
  • 2
  • 23
  • 38
Mxmln
  • 11
  • 1
  • You can try grid, examples here: https://stackoverflow.com/questions/41164675/adding-a-table-of-values-below-the-graph-in-ggplot2, or check this solution: https://stackoverflow.com/questions/44358204/show-the-table-of-values-under-the-bar-plot – Grzegorz Sapijaszko Jan 24 '22 at 10:40

0 Answers0