-
Notifications
You must be signed in to change notification settings - Fork 118
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
xmod for tm_text #840
Comments
Not deprecated, rather not implemented yet. What would be the best option from a user perspective (@afolson-NOAA @Nowosad ):
The 3rd option is definitely the most elegant one I think, especially because we still need sophisticated to (re)implement automatic text labeling. Say we would like to move the label "Paris" in the metro dataset. A work flow could be: metro$offset_y = ifelse(metro$name == "Paris", 1, 0)
tm_shape(metro) +
tm_dots(fill = "red") +
tm_text("name", ymod = "offset_y") Under the hood, the scaling function is The scaling function |
Great to hear it is planned for inclusion in V4. I agree that coordinates are not very intuitive so Options 1 or 3 make sense to me. I'm a novice at tmap and spatial analysis in R, but have some older experience with regular GIS mapping software. I'm quite impressed with what can be done in R. |
Hi all -- I also prefer solution 1 or 3. That being said -- I think it would be good to start by thinking about a larger picture. As @mtennekes mentioned, automatic text labeling is the long term goal, so it would make sense, in my opinion, to understand what is needed for that purpose. |
Working: ## xymod
metro$initial = substr(metro$name,1,1)
metro$az = (match(metro$initial, LETTERS)-1) /25
tm_shape(metro) +
tm_dots("red") +
tm_text("initial", ymod = "az") Just a toy example where the ymod is determined by the first letter of the city name. First, I tried to implement a variable called |
FYI, I added For |
Another thing: the layer options were contained in |
It looks like xmod and ymod are deprecated. Will there be an alternative method to offset tm_text so that it does not overlap tm_dots()?
The text was updated successfully, but these errors were encountered: