-
Notifications
You must be signed in to change notification settings - Fork 2.1k
better documentation for map related functions? #3717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Some quick comments.
In my understanding,
They are not functions, but topics, which you can read on By the way, as |
I just never explored If geom_map is bound to be deprecated some of these remarks lose their relevance obviously. However I think the larger point remains, it seems to me that it is very intimidating to learn how to plot a simple map (fill a handful of countries or states with colors mapped to a value).
I feel that if I have a I would have liked to do something like On stack overflow I find these answers when looking for "plot world map": https://stackoverflow.com/questions/9805895/mapping-the-world-on-ggplot2 : 5k views, uses |
Ok so since the issue was filed:
This leaves the |
Here are several comments, They're linked but I'm happy to split them into several issues if it's preferable.
geom_map()
The titles and descriptions of
geom_map
are :I think this could be clearer,
geom_map
wraps the functionalities ofgeom_polygon
to plot maps. the difference being that we provide a reference map through themap
argument, which takes care of thex
andy
aesthetics and allows us to use a more convenientdata
argument.The description of the
map
argument doesn't mention themap_data()
function (only an example does), tough it will probably be useful in most cases. Instead it says :fortify()
If we follow to fortify's page we read :
It doesn't say what
fortify()
does, says we shouldn't use it anyway, and refers to broom without telling us which functions from broom we should use (we might think it's justbroom::fortify()
but it doesn't exist).map_data()
The
map
argument is described as :But none of these functions exist.
From examples we can infer that we can use a string such as "state", but the doc seems to hint that we might have more choice than what's in this list, and doesn't tell us where to look. The following argument hints that we can look at
?maps::map
, and there we find that we can infer the list of available maps by lookinghelp(package='maps')
. I think it is very convoluted and we would benefit from having these maps enumerated in the ggplot2 doc.coord_map()
The
projection
argument is forwarded tomapproj::mapproject
so I understand that you decide to redirect the user there, but again, once there we need to read and scroll to get a list of possible values and it all adds up for a user who "just wants to draw a map", as this one : https://twitter.com/calvinmdewilde/status/1215116524798636032.So here as well, could we have in ggplot2's doc the list of available projections ?
a map vignette ?
I believe a vignette focused on maps would be extremely helpful. It could showcase all the projections and a couple cases of maps (world, US). At the moment if I google "ggplot maps" I find mostly references discussing
geom_polygon()
so it seems thatgeom_map()
is under-advertised, which I think is unfortunate as map charts are very popular these days.The text was updated successfully, but these errors were encountered: