[R] text duplication bug in mtext?

Arkay arkay7777 at gmail.com
Fri Jan 1 19:36:26 CET 2016


Not sure if this has already been reported but I think that there might 
be a bug in mtext that causes the text in a plot to be duplicated under 
a narrow set of circumstances.

Here is a reproducible example.

df1 <- data.frame(V1=rnorm(100))
hist(df1$V1)
mtext("Test", side=1, line=4, adj=c(1,0)) # causes text to appear 
twice

This does not appear to happen if adj=c(0,0) or if the adj argument is 
removed altogether:

hist(df1$V1)
mtext("Test", side=1, line=4, adj=c(0,0))

Furthermore, it looks like using the "at" argument causes the spacing 
between the duplicated text to disappear:

hist(df1$V1)
mtext("Test", side=1, line=4, at=0, adj=c(1,0))

Some additional information related to my R installation.

sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8.1 x64 (build 9600)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United 
States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United 
States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rj_2.0.3-2

loaded via a namespace (and not attached):
[1] tools_3.2.3



More information about the R-help mailing list