Closed jspmccain closed 3 years ago
Hi Scott - text
will work, you just need to make sure you are working with data that's in the same projection as the map:
example_df <- data.frame(long = runif(10, 130, 200), lat = runif(10, -85, -60), station = letters[1:10])
SOmap_auto(example_df$long, example_df$lat)
The plotted map is in projected coordinates. To get our long-lat data into the same projection:
exdf_p <- SOproj(example_df)
which is a SpatialPointsDataFrame. And finally:
text(exdf_p, labels = example_df$station)
SOtext()
a good idea though, there'd be a good case for extending each of the base plot calls for the "projection handling" for the current plot from longlat data.
I'd like to revisit this, but it would be a package that SOmap imports, something that does this projection-context stuff - so no promises or timeline but its' certainly on the radar
Thank you!
I'm wondering how to add point labels to the plot after using SOmap_auto().
I've tried using the text() function similar to how this might be done in base R, but I can't seem to get it to work. I wonder if it there is a simple solution that I'm just not seeing?
For example:
I would also want there to be corresponding labels (
A
etc.).Thank you!