[Rd] Bug in axis labels (PR#7860)

murdoch at stats.uwo.ca murdoch at stats.uwo.ca
Fri May 13 00:37:17 CEST 2005

Bob O'hara wrote:
> I'm a bit reluctant to call anything a bug: I know it's usually my 
> incompetence instead.  In this case, I can't see what else it is, 
> although it may be a bug in Windows.
> The problem comes from trying to create a .png of a figure in Windows 
> XP, with R2.1.0.  On the screen it looks OK, but in the .png the text 
> for the x label is smaller than for the y label.  The problem seems to 
> be created by using axes=F in plot().  Here's some code to demonstrate 
> the problem:
> XX=1:5;  YY=1:5
> png("thing.png")
> par(mfrow=c(2,1))
>  plot(XX, YY, axes=F, xlab="X label", ylab="Y label")
>  plot(XX, YY, xlab="X label", ylab="Y label")
> dev.off()
> I get a similar problem with bmp() and jpeg(), but not postscript() or 
> pdf().  If I draw the figure in the window in R and then save it as a 
> .png from the menu, the png looks fine.
> Everything works fine in R1.5.1 (I know, I know!) on Debian Linux, which 
> is why I'm reporting this as a Windows problem.

I see the problem in the first figure, and it's still there in a recent 
r-devel build.  My test was also on Windows. Since png() uses the 
Windows graphics driver, it does look like an R bug in the Windows 
graphics driver, but I'd like to hear from someone on a different 

Duncan Murdoch

More information about the R-devel mailing list