wilkelab / cowplot

cowplot: Streamlined Plot Theme and Plot Annotations for ggplot2
https://wilkelab.org/cowplot/
704 stars 84 forks source link

Better error draw_text when x or y exceeds the drawing size? #78

Closed tbates closed 7 years ago

tbates commented 7 years ago
ggdraw() + draw_text("Hello World!", x = 1, y = 2)

Warning message: Removed 1 rows containing missing values (geom_text).

Suggested error message:

"one more more values in x or y were outside the legal range",

clauswilke commented 7 years ago

The error message is generated by geom_text. Not sure it's worth the effort to catch this error and then rephrase. Also, if you do it for draw_text you'd have to do the same for every other of the draw functions. A lot of work, and a lot of added code that doesn't immediately do anything useful.

tbates commented 7 years ago

Makes sense. It confused me, as the data aren't missing. But probably a feature request for ggplot2 as fixing there will help more folk. Cheers, t