R-alpha: X11/Postscript Hardcopy bug

Ross & ihaka@stat.auckland.ac.nz
Thu, 12 Jun 1997 12:11:33 +1200 (NZST)


A couple of people have come across this recently (piecharts and
boxplots trigger it I think.  Here is a fix (not a patch because
a new release is at hand).

In the C code in src/unix/psx11.c, replace the function psx11_Polygon
with the following code.
	Ross

- - - s n i p - - - h e r e - - -

void psx11_Polygon(int n, double *x, double *y, int bg, int fg)
{
        int i;
        if(bg != NA_INTEGER) {
                psx11_SetColor(bg);
                fprintf(psfp, "np\n");
                fprintf(psfp, "%.2f %.2f m\n",
                        xoffset + xscale * x[0],
                        yoffset + yscale * y[0]);
                for(i=1 ; i<n ; i++) {
                        fprintf(psfp, "%.2f %.2f l\n",
                                xoffset + xscale * x[i],
                                yoffset + yscale * y[i]);
                }
                fprintf(psfp, "cp f\n");
        }
        if(fg != NA_INTEGER) {
                psx11_SetColor(fg);
                fprintf(psfp, "np\n");
                fprintf(psfp, "%.2f %.2f m\n",
                        xoffset + xscale * x[0],
                        yoffset + yscale * y[0]);
                for(i=1 ; i<n ; i++) {
                        fprintf(psfp, "%.2f %.2f l\n",
                                xoffset + xscale * x[i],
                                yoffset + yscale * y[i]);
                }
                fprintf(psfp, "cp o\n");
        }
}
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-