这是indexloc提供的服务,不要输入任何密码
Skip to content

tmap plots a border around a map while draw.frame=F #32

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

Closed
wants to merge 1 commit into from

Conversation

sjewo
Copy link
Collaborator

@sjewo sjewo commented Sep 27, 2015

I noticed tmap drawing a white line through my legends, even when I set draw.frame to FALSE. The following change fixed this issue for me.

Thanks for this awesome package!

@mtennekes
Copy link
Member

Thanks for your suggestion!
It may have seemed like a bug, but it actually is a hack:-)

This "hidden rectangle" is used to hide cutted polygon borders.
For instance, see

data(Europe)
qtm(Europe, fill="income_grp") + tm_layout(draw.frame=FALSE) 

The polygons of all countries that cross the frame are cut. However, these cut lines, that lie exactly on the frame border, are artificial borders, so therefore I hide them.

Strange that this line is shown through the legend. That's what I've found too if the legend is positioned across the frame:

qtm(Europe, fill="income_grp") +
tm_layout(draw.frame=FALSE, legend.position=c(.10,.9))

I'll try to fix this soon.

@sjewo
Copy link
Collaborator Author

sjewo commented Sep 28, 2015

Thanks for your reply!
Maybe you could change the plot order, so the legend will be plotted over the rectangle? The same approach could be used with the frame: always plot the white rectangle and just overplot it with a colored frame if draw.frame=T.

@mtennekes
Copy link
Member

My thoughts exactly, thanks!

@mtennekes mtennekes closed this in c7e9eec Oct 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants