0

I want to display rectangles like in the image below with their real sizes (each rectangle has a length "dl" and a width "dw")

enter image description here

      ggplot() + 
      ggtitle("top+bot") +

      geom_rect( data = grid, aes(xmin = grid["x"], xmax = grid["x"]+ grid["dl"],
                              ymin = grid["y"], ymax =grid["y"]+ grid["dw"], 
                              fill = T, color = "blue"), 
                              alpha = (gridtop$z/op)) })pe here

When I try to run this code, there is nothing displayed, do you know what the problem is?

Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
  • Within `aes()` you should use direct column names, i.e. `xmin = x, xmax = x + dl`. Try that or provide a reproducible example. – Roman Luštrik Feb 07 '23 at 13:12

0 Answers0