[R] MacOS X Quartz Rendering? (Solved)
Neil Gunther
njgunther at perfdynamics.com
Sat Mar 25 08:11:50 CET 2006
The problem has been solved and thankfully, it has nothing to do with Quartz and
almost nothing to do with R. Before explaining briefly, I want to thank Kevin
Middleton, Don MacQueen, and Jim Holtman for offering their help. This kind of
support makes using tools like R even better (especially for newbies like me).
It turns out that the problem had to do with the format of the data being used
to generate the plots. Although I didn't mention it in my question, the data was
being read in from a formatted file (produced by someone other than me). One of
the things I found impressive about R was the ease with which it read in the
file. That reaction was based, in part, on being a Mathematica user and having
struggled more to get it to read the same file on an earlier occasion. That may
not have been such a bad thing after all.
Don MacQueen was the one who asked the right questions that led to me reveal the
file format as:
Date Value
00-03-27 129622
00-03-28 129285
00-03-29 141328
00-03-30 130223
.....
He immediately recognized that the "Date" column was going to cause trouble
unless R was given more explicit instructions about how to treat it viz., as a
string!
In lieu of that (and this is the not so good part), R decides to be "helpful"
and treat that column as integers. Probably (I haven't done the detailed
analysis) that led to each triple of integers being computed as a pair (the 00-
being treated as a zero) which led to each "dot" in the plot being displayed as
a pair of dots, with further confusion apparently causing R to render the "dots"
as something more complex (e.g., "knots"). You get the idea.
Whether to interpret certain values as numbers or strings is an old I/O gotcha.
What had me fooled was that the plot *looked* correct, when compared to the
Mathematica plot, but it was taking far too much time to render on PPC Quartz!
--njg
Neil Gunther wrote:
> I just tried rendering a plot of 166 data point (time series) on my PPC
> mac,
> and compared it with the same data rendered by Mathematica. The R
> plotting is very slow to paint and repaint, compared to Mathematica.
> This also makes it extremely awkward to use in other documentation such
> as pdfLatex.
>
> On closer inspection, it looks like the Mathematica plot is just a
> polyline, while in R it is a B-spline with each marker consisting of 24
> B-splines knotted together. Moreover, the spline joints are rounded,
> which requires computing two circles and intersecting them 26 times at
> each bend.
>
> Is there some reason why the point-markers are not just drawn as circles
> or squares, instead of doing these complicated and time-consuming knots?
>
> -- njg
> ________________________________________________________________________
>
> PERFORMANCE DYNAMICS COMPANY http://www.perfdynamics.com/
> ________________________________________________________________________
More information about the R-help
mailing list