paleolimbot / ggspatial

Enhancing spatial visualization in ggplot2
https://paleolimbot.github.io/ggspatial
371 stars 35 forks source link

"Scale on map varies by more than 10%, scale bar may be inaccurate" with rnaturalearth world map #109

Open S-AQ opened 1 year ago

S-AQ commented 1 year ago

Hi Dewey,

When I tried to add a scalebar to a world map of data from rnaturalearth, I got the following warning: Scale on map varies by more than 10%, scale bar may be inaccurate.

library(ggspatial)
library(rnaturalearthdata)
world_countries <- ne_countries(returnclass = 'sf')

ggplot()+
  layer_spatial(world_countries)+
  annotation_scale(location = "tl")

Somehow the annotation_scale is not aware of the specifics of the world_countries object. A similar problem occurred here, but that was never solved by anyone.
How can I get the right scale bar with this data?

image

DavidBoring commented 1 year ago

oh,I met the same question. Dear friend,Did you solve the problem?

paleolimbot commented 1 year ago

It's telling you that the scale bar does not necessarily apply in the same way to all areas of the map, which is true! You should probably not be putting a scale bar on a map with a scale that large (or you can accept that it is not accurate to do so and ignore the error message).

DavidBoring commented 1 year ago

Yes, I very much agree with what you said! I was just trying to ask you for help on GitHub and was pleasantly surprised to receive your email,thank you very much. I am a beginner in R, thanks for the answer! :)

---- 回复的原邮件 ---- | 发件人 | Dewey @.> | | 日期 | 2023年03月31日 22:08 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [paleolimbot/ggspatial] "Scale on map varies by more than 10%, scale bar may be inaccurate" with rnaturalearth world map (Issue #109) |

It's telling you that the scale bar does not necessarily apply in the same way to all areas of the map, which is true! You should probably not be putting a scale bar on a map with a scale that large (or you can accept that it is not accurate to do so and ignore the error message).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>