After setting graphical parameters using par(fig) and resetting them with the initial parameters, the text in the graph fields is not recorded. Only after executing another low level command inside the charting area will it work again. Here is an example:
dev.off() plot(1:10) op <- par(no.readonly = TRUE) mtext("hello", adj=1, col=2) # written as expected par(fig=c(0.1,0.6,0.5,0.8), new=TRUE) par(op) mtext("hello ", adj=1, col=3) # not written mtext("hello ", adj=1, col=3, line=-1) # works inside plot region mtext("hello ", adj=1, col=3) # still not written text(50,20,"") # or abline # do something inside plot region mtext("hello ", adj=1, col=3) # now it works!
This may be due to another question that I posted under after par (Fig.), Mtext is a bit disabled .
In addition, mtext , axis also does not work. In addition, text/abline/points , title(main="dummy") also solves the problem.
Could this be an R error? Or am I missing something?
source share