I am trying to create an app using ShinyR
, and am using ggplot to create some dynamic graphs. I have used :
annotate("text", -Inf, Inf, label = "Label",
hjust = 0, vjust = 1, col = "red", fontface = "bold")
to create some wording in the top corner of my graph. I positioned it absolutely because the height/width of the graph changes with user input. This text is sometimes hard to read from the graph so I thought of 2 ways to make it easier to read, neither of which I have been able to implement:
- Put a box around the text.
- Problem: I don't know how to absolutely position a box in
ggplot
.
- Problem: I don't know how to absolutely position a box in
- Move the text underneath the graph
- Problem: when I try this I into issues because the label uses some information from the code found in
renderPlot
, which I don't know how to access with arenderText
.
- Problem: when I try this I into issues because the label uses some information from the code found in
The red text, which is absolutely positioned, is what I'm hoping to make more visible with a box: