mcintosh@research.telcordia.com
2004-Oct-08 21:45 UTC
[Rd] Bug with png() and plot(type="n") (PR#7270)
Full_Name: Allen McIntosh Version: 2.0.0 OS: Linux Submission from: (NULL) (67.80.175.118) Observed the bug with the following combinations: (RedHat 7.3, R 1.6.0) (RedHat 7.3, R 1.9.1) (Redhat 9, R2.0.0). In the second plot (.png file) produced by the following sequence: png(file="x%d.png") plot(1:10,1:10,main="ooo",type="n") segments(1:9,1:9,2:10,1:9) plot(1:10,10:1,main="XXXX",type="n") the axis labels, the tick marks and the title from the first plot have not been erased. The call to segments() seems to be necessary, as does type="n". The example I extracted this from also called abline(), which was sufficient to trigger the bug. Inserting a call to frame() after the call to segments() results in an extra file that ought to be blank, but instead contains the offending text and tick marks. Workarounds short of multiple calls to png() appreciated.
mcintosh@research.telcordia.com writes:> Full_Name: Allen McIntosh > Version: 2.0.0 > OS: Linux > Submission from: (NULL) (67.80.175.118) > > > Observed the bug with the following combinations: (RedHat 7.3, R 1.6.0) (RedHat > 7.3, R 1.9.1) (Redhat 9, R2.0.0). > > In the second plot (.png file) produced by the following sequence: > > png(file="x%d.png") > plot(1:10,1:10,main="ooo",type="n") > segments(1:9,1:9,2:10,1:9) > plot(1:10,10:1,main="XXXX",type="n") > > the axis labels, the tick marks and the title from the first plot have not been > erased. The call to segments() seems to be necessary, as does type="n". The > example I extracted this from also called abline(), which was sufficient to > trigger the bug. Inserting a call to frame() after the call to segments() > results in an extra file that ought to be blank, but instead contains the > offending text and tick marks. > > Workarounds short of multiple calls to png() appreciated.Apparently, the clipping of segments is still active when the drawing surface is erased. Inserting a call to box() before the 2nd plot seems to help. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907
On 8 Oct 2004, Peter Dalgaard wrote:> mcintosh@research.telcordia.com writes: > > > Full_Name: Allen McIntosh > > Version: 2.0.0 > > OS: Linux > > Submission from: (NULL) (67.80.175.118) > > > > > > Observed the bug with the following combinations: (RedHat 7.3, R 1.6.0) (RedHat > > 7.3, R 1.9.1) (Redhat 9, R2.0.0). > > > > In the second plot (.png file) produced by the following sequence: > > > > png(file="x%d.png") > > plot(1:10,1:10,main="ooo",type="n") > > segments(1:9,1:9,2:10,1:9) > > plot(1:10,10:1,main="XXXX",type="n") > > > > the axis labels, the tick marks and the title from the first plot have not been > > erased. The call to segments() seems to be necessary, as does type="n". The > > example I extracted this from also called abline(), which was sufficient to > > trigger the bug. Inserting a call to frame() after the call to segments() > > results in an extra file that ought to be blank, but instead contains the > > offending text and tick marks. > > > > Workarounds short of multiple calls to png() appreciated. > > Apparently, the clipping of segments is still active when the drawing > surface is erased.Yes, and a fix has now been committed to R-patched/R-devel. -- Brian D. Ripley, ripley@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
ripley@stats.ox.ac.uk
2004-Oct-11 16:00 UTC
[Rd] Bug with png() and plot(type="n") (PR#7270)
On 8 Oct 2004, Peter Dalgaard wrote:> mcintosh@research.telcordia.com writes: > > > Full_Name: Allen McIntosh > > Version: 2.0.0 > > OS: Linux > > Submission from: (NULL) (67.80.175.118) > > > > > > Observed the bug with the following combinations: (RedHat 7.3, R 1.6.0) (RedHat > > 7.3, R 1.9.1) (Redhat 9, R2.0.0). > > > > In the second plot (.png file) produced by the following sequence: > > > > png(file="x%d.png") > > plot(1:10,1:10,main="ooo",type="n") > > segments(1:9,1:9,2:10,1:9) > > plot(1:10,10:1,main="XXXX",type="n") > > > > the axis labels, the tick marks and the title from the first plot have not been > > erased. The call to segments() seems to be necessary, as does type="n". The > > example I extracted this from also called abline(), which was sufficient to > > trigger the bug. Inserting a call to frame() after the call to segments() > > results in an extra file that ought to be blank, but instead contains the > > offending text and tick marks. > > > > Workarounds short of multiple calls to png() appreciated. > > Apparently, the clipping of segments is still active when the drawing > surface is erased.Yes, and a fix has now been committed to R-patched/R-devel. -- Brian D. Ripley, ripley@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