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
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).
Any help would be most welcome. Thanks.
(This was originally posted to the sf repo but was posted here at the suggestion of yutannihilation who said "I guess coord_sf() forgets to squash Inf within the range, which coord_cartesian() does.")
The text was updated successfully, but these errors were encountered:
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
lockbot
locked and limited conversation to collaborators
May 26, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
I never see "Top-left" on the plot no matter what values I've tried for hjust or vjust.
Second attempt, using textGrob (via this comment):
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).Any help would be most welcome. Thanks.
(This was originally posted to the sf repo but was posted here at the suggestion of yutannihilation who said "I guess coord_sf() forgets to squash Inf within the range, which coord_cartesian() does.")
The text was updated successfully, but these errors were encountered: