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

Multiple plots does not work (on Windows) for plot() function #157

Open
P-Barnabas opened this issue Nov 18, 2023 · 1 comment
Open

Multiple plots does not work (on Windows) for plot() function #157

P-Barnabas opened this issue Nov 18, 2023 · 1 comment

Comments

@P-Barnabas
Copy link

When running the code below the multiple plot results in a plot only in the top left position of the multiplot. The plot which is shown in the output is the last plot (I checked for instances of plotting different plots on a multiplot) so it seems that the Racmacs plot function always plots to the first position on a multiplot.

library(Racmacs)

map <- read.acmap(system.file("extdata/h3map2004.ace", package = "Racmacs"))

par(mfrow=c(2,2))
for (i in 1:4){
  plot(map)
}

The heart of the problem is that the Racmacs plotting function resets the position the next plot should be located in for multiple plots to the first position. When the Racmacs plot is used after a standard plotting function it does produce a plot on the next position, however, in the reversed order, the standard plot is put in the top left corner and all other previous plots are erased.

par(mfrow=c(2,2))
plot(map)
plot(1:4,1:4)

(above) Results in the second plot in the top left corner

par(mfrow=c(2,2))
plot(1:4,1:4)
plot(map)

(above) Results in the first plot in the top left and the second (the acmap) in the top right

par(mfrow=c(2,2))
plot(1:4,1:4)
plot(1:4,1:4)
plot(map)
plot(1:4,1:4)

(above) Results in only the last plot displayed in the top left corner, since the Racmacs plot reset the multiple plots

@drserajames
Copy link
Member

A couple of others points

  • This works fine on Mac, it's on windows that we see the problem
  • It's not a general problem with mfrow as other multiplots can be generated, it's a specific plot.acmap issue

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

No branches or pull requests

2 participants