Thanks to everyone who responded! After my comments are snippets from
some of the responses that I received. I haven't identified anyone
since some asked not to be identified and I wasn't sure about the
others.
1. The suggestion to use S-PLUS version 6 is something that I'd like to
try -- whenever it is available. We tried to use the beta but it
wouldn't install. A few days ago I asked Insightful when the production
Windows version will be available but haven't had a reply yet.
2. One new book was suggested: Krause and Olson "The Basics of S and
Splus', Springer 1997, 2000.
3. I never have been able to get xlim=c(1985,2002) to work. The S-PLUS
help for the xlim parameter in par says "approximate minimum and maximum
values to be put on x-axis. These values are automatically rounded to
make them "pretty" for axis labeling." xlim won't honor the exact
values that I try to use.
4. I think that the approach outlined in response 3 will probably work,
or at least get me farther along. It's a little awkward to create the
dummy data and keep it in cts format.
Response 1
I think in your case, time series, you need to be using S-PLUS 6.0.
A release candidate for Windows is available. Otherwise library chron
can
help. You set par xlim to set the axis limits, for example.
Response 2
I'm using Splus on unix, version 6, and there are probably enough
version differences in the time series functions that I can't help
you. In particular, there was a huge set of new timeSeries functions,
both analytical and graphical, introduced in v5 on unix, and I don't
know which, if any, Windows version they made it into. I believe they
will be in v6 for Windows, that I have heard is in beta testing now.
In general, however, Splus allows user specified axis limits for any
2-d plot, usually through the "xlim" and "ylim" arguments to a
plotting function. At present there is a known bug in the unix
version that prevents this in the y-axis of time series plots.
As someone who has also done a good bit of SAS/GRAPH programming, I
would say it's not true in general that Splus's range of graphics
controls is less than that of SAS/GRAPH. There are undoubtedly some
features in SAS that are easily done in SAS but difficult to do in
Splus, and vice-versa. In my experience, if you have an idea for a
graph that is not one of the built-in vendor-provided ones, it will
be much easier to create it in Splus than in SAS/GRAPH.
As far as documentation is concerned, perhaps you have manuals for
2000 R3 that are analogous to the "Programmer's Guide" and "Guide to
Statistics" for the unix versions.
The Programmer's Guide has a chapter titled "Traditional Graphics"
which describes much of the fundamental graphics capability.
Specialized time series graphics are described in the "Guide to
Statistics" manual.
Response 3
A quick and simple way to get a graph to obey different conventions is
to
do something like this:
plot( x.phony, y.phony, type="n", <other args as desried> )
lines( x.line.coord, y.line.coord )
points( x.point.coord, y.point.coord)
You set up x.phony, y.phony to span the range you wnat the graph to
represent. e.g.
x.phony <- c(0,15)
y.phony <- c(-5,5)
Then lines(), points(), text(), etc are used to add the actual graphics.
Producing elegant graphics in SPlus or in R requires some study of the
par() help page. I usually open it up whenever I start in on a new
graphic
to sort out issues like spacing, labelling, suppressing labels, and so
on.
It may also help you to suppress the plotting of axes by plot() and
customize them via axis().
Also, suppressing the default text labels and using mtext() is also
helpful.
Splus and R can produce essentially any graph thru a combination of
higher
and lower order controls. But knowing where to look for which cotnrol is
the crux...
Response 4
Have you looked at "par"? In your example, it sounds like
xlim=c(startdate,enddate) is what you want.
I hope there aren't too many people who flame you for this email. SAS
has
advantages over S-Plus, but among my statistical friends there is a
general
consensus that S-Plus is better at graphics than SAS. Not to say that
it is
easy to manipulate the presentation of the graphics (any more than it is
easy using SAS/GRAPH), but almost everything in S-Plus graphics can be
adjusted.
Response 5
I use both SAS/GRAPH and S-plus.
Your diagnostic is pretty accurate. Its much more easier to make a
customized graphics with SAS/GRAPH. However S-plus is good for
prototyping plots. In other words, if you want to produce very
professional
graphics with S-plus it takes more work.
Response 6
As someone who used SAS for 23 years before discovering S-Plus
I think I can safely say that S-Plus allows far more control of
graphics than SAS. The real issue here is that you are using
a date variable. When using Cleveland's Trellis graphics,
one way to have a good deal of control is to give xyplot
a regular numeric rendering of the date variable, and to
use the scales argument to provide the vector of values at
which to make tick marks, and the character vector of
corresponding labels. This is not unlike using a log
scale on the x-axis (for which there is probably more
examples available) with xyplot.
Another user will probably provide you with an example
for how to plot date variables using functions that
are built into S-Plus, in either Trellis or
standard graphics.
Response 7
Documentation is scattered. Probably you would need a Splus
documentation e.g. User's guide. Also Krause and Olson book "The
Basics of S and Splus', Springer 1997, 2000 may be useful. In V&R book
see Table 3.4 on p.85.
Well, I also consider myself to be experienced SAS user. When comes to
graphics I almost always try to use Splus and it seems to be much
better than SAS.
Try something similar to:
ts.plot(deaths, xlim = c(1970,1980))
where deaths is an example of time series. Example with syntax
ts.plot(deaths) is given in V&R p. 433 (1997).
-----Original Message-----
From: Wally Danielson
Sent: Wednesday, June 27, 2001 10:32 AM
To: s-news@lists.biostat.wustl.edu
Subject: [S] Presentation Graphics
I am an experienced SAS and SAS/GRAPH programmer who is learning S-PLUS
2000 R3 on Windows 2000. I have read all of the S-PLUS 2000 manuals as
well as two books by independent authors ("Modern Applied Statistics
with S-PLUS" by Venables and Ripley and "Visualizing Data" by
Cleveland). I can't find enough documentation about how to control
presentation quality graphs. I'm particularly interested in time series
graphs. Would someone please recommend some documentation on the
mechanics of this process? It appears to me that S-PLUS doesn't offer
nearly the range of graphics controls that SAS/GRAPH does.
For example, I have weekly data spanning many years. I'd like to
present the weekly data using an x-axis labeled with the years. I'd
like the x-axis to start on January 1 of the first year, even though the
data starts mid-year. I'd like the x-axis to stop on December 31 of the
last year, even though the data stops mid-year. I've tried storing the
data as a data frame, simple vector, and cts.
I've noticed many queries about controlling graphics in the list server
archives. Most of them went unanswered. It appears that either there
isn't much of an answer (i.e., S-PLUS is deficient in this area) or the
list server participants aren't interested in this area. I'm hoping
that it isn't the first.
Thanks for your help!
---------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
|