Hello,
I have generated a map in ggplot, but plotted only the area between two sets of coordinates and would like to apply a scalebar. Using the x.min x.max etc. commands, the scale bar does appear, however no text appears.
The warning message "Removed 3 rows containing missing values (geom_text)." appears whenever my code is run.
Below is an example, apologies if it is not suitable. Please let me know if there are any issues with it:
Hello, I have generated a map in ggplot, but plotted only the area between two sets of coordinates and would like to apply a scalebar. Using the x.min x.max etc. commands, the scale bar does appear, however no text appears. The warning message "Removed 3 rows containing missing values (geom_text)." appears whenever my code is run.
Below is an example, apologies if it is not suitable. Please let me know if there are any issues with it:
`install.packages('mapdata','maps','maptools') devtools::install_github("dkahle/ggmap") library(ggplot2) library(ggmap) library(maptools) library(maps) library(mapdata) library(ggsn)
japan <- map_data('japan')
JapanMap <- ggplot() + geom_polygon(data = japan, aes(x = long, y = lat, group = group)) + xlim(c(138, 144)) + ylim(c(35, 42)) + scalebar(x.min = 138, x.max = 144, y.min = 35, y.max = 42, dist = 50, dd2km = T, model = 'WGS84', location = 'bottomright', anchor = c(x = 144, y = 35, st.size = 3))`
Attached is the resultant map with scalebar but missing text
Many thanks,
Aran