Skip to content
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

Missing legends/text on plot(map) #145

Open
drserajames opened this issue Feb 17, 2023 · 1 comment
Open

Missing legends/text on plot(map) #145

drserajames opened this issue Feb 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@drserajames
Copy link
Member

When using plot(map), the borders of the plot can not have text or a legend on them. Resolved by setting par(mar=rep(0,4)) prior to calling plot.

> library(Racmacs)
> packageVersion("Racmacs")
[1] ‘1.1.38’
> 
> set.seed(123)
> dat <- matrix(10*2^round(10*runif(100)), ncol=10)
> set.seed(456)
> map <- make.acmap(dat, verbose=F, options=list(report_progress = F))
> plot(map)
> legend("bottomleft", c("lots", "of", "important", "things"))
> legend("bottomright", c("lots", "of", "important", "things"))
> legend("topleft", c("lots", "of", "important", "things"))
> legend("topright", c("lots", "of", "important", "things"))
> text(0,0, "Cos I wonder where you are")
> text(-5, 5, "Is it me you're looking for?")
> text(-5, 7.2, "Hello")

Rplot01

par(mar=rep(0,4))
plot(map)
legend("bottomleft", c("lots", "of", "important", "things"))
legend("bottomright", c("lots", "of", "important", "things"))
legend("topleft", c("lots", "of", "important", "things"))
legend("topright", c("lots", "of", "important", "things"))
text(0,0, "Cos I wonder where you are")
text(-5, 5, "Is it me you're looking for?")
text(-5, 7.2, "Hello")

Rplot02

@drserajames drserajames added the bug Something isn't working label Feb 17, 2023
@judyssister
Copy link

Dear Sarah, I am confused about what will be added to the map when using the legend() function. I only can see a box with black text. However, I hope for a series of colored circles and rectangles as a legend like the attached figure. Could please give me some suggestions about the legend ?

image

Thank you very much.
Cheers,
Jing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants