You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to add text annotation to geom_sf plot #879
I would like to use relative positioning (0-1 scale) to add a text annotation to a ggplot object that uses geom_sf. I've tried two different methods that were mentioned here, but both seem to fail with different results.
First attempt, using Hadley's suggestion does produce any annotation:
This results in "Error in grid.Call.graphics(C_setviewport, vp, TRUE): non-finite location and/or size for viewport". I get the same results if I specify x and y locations in textGrob with different units (npc, cm, lines).
Activity
yutannihilation commentedon Oct 31, 2018
Could you file this issue on ggplot2's repo? I guess
coord_sf()forgets to squashInfwithin the range, whichcoord_cartesian()does.sschloss1 commentedon Oct 31, 2018
Filed with ggplot2 at tidyverse/ggplot2#2971
yutannihilation commentedon Oct 31, 2018
Thanks! I think you can close this issue here.