[R-SIG-Mac] possible bug in quartz?

Denis Chabot chabotd at globetrotter.net
Mon Oct 10 13:43:51 CEST 2005


Hi,

I recently asked a question on the general r-help list about how  
using xaxp in plots. In trying out a suggestion I found out that the  
following short program resulted in a plot that was different in  
quartz than on Windows. Mind you R2.2 was used on Windows and I used  
R2.1. However
Le 05-10-08 à 13:21, Prof Brian Ripley a écrit :

>> ...
>> Anyway it is too finicky, I will draw them myself. For instance,
>>
>> plot(1:100, xaxt="n")
>> par(xaxp=c(0, 100, 10))  # the value is reset at each plot
>> axis(1)
>>
>> Placed tick marks at intervals at 0, 10, ..., 100, as expected,  
>> but did not place a label under 100...
>>
>
> Does for me (2.2.0, Windows and X11 on Linux).  Might the text be  
> clipped on your unnamed device, so you need to set xpd?  (If so, it  
> will be clipped however you try to do this, and is an unrelated  
> local problem.)
>
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>
I tried to check if clipping was involved by adding space for the  
right margin with
par(mai=c(0.7, 0.7, 0.5, 0.5))
to no avail. I tried changing xpd as suggested by Brian and this did  
not solve the issue.

Interestingly
par(mai=c(0.7, 0.7, 0.5, 0.5))
plot(1:100, xaxt="n")
par(xaxp=c(0, 100, 9))  # the value is reset at each plot
axis(1)

produces a label under "100" that has reads "100.00000" so my mai  
parameter was effective in preventing clipping in the second example,  
but not the first one.

The original program works fine with pdf so the problem seems limited  
to quartz.
pdf(file="test.pdf")
plot(1:100, xaxt="n")
par(xaxp=c(0, 100, 10))  # the value is reset at each plot
axis(1)
dev.off()

Can someone please test if this will be still true under R2.2?

Sincerely,

Denis Chabot



More information about the R-SIG-Mac mailing list