I have a two-part question:
- I am struggling to figure out how to make the Northeast United States' abbreviations on my map smaller so they actually fit in the state boundaries, or if I could make those lines that point to the state. My apologies, I have little background in cartography.
Specifically, VA, MT, CT, NJ are all small states, and that part of the map looks crowded.
- I would like to put some kind of text outline to see the text against the white background. Is there code for that?
Here is my current code:
# apply state abbreviations
centroid_labels <- usmapdata::centroid_labels("states") # df with lat and long coordinates, state anme, and abbreviations
state_labels <- merge(statecounts, centroid_labels, by = "fips") # merge above df
myPalette <- colorRampPalette(rev(brewer.pal(11, "RdYlBu")))
usmap3 <- plot_usmap(data = statecounts, regions = "state", values = "n") +
geom_text(data = state_labels, aes(x = x, y = y, label = stateabbr), color = "white") +
scale_fill_gradientn(name = "Count", colours = myPalette(50)) +
labs(title = "Frequency of Unique Users in the United States",
caption = "",
fill = "Count")
usmap3
And here is my map:

geom_texthas asizeattribute that you can set. In your case try: