Thanks to all who wrote back.
The concensus was to use the wmf format and move on with life. Jean wrote
back with the most detailed steps (I missed her original post on this topic
from October 7 2005, it's pasted below). My conclusion is that it should be
easier and without any compromise in quality. The wmf is fine, but still
leaves something to be desired; Jean's multiple steps seem too much for
regular use (but did seem to work pretty well, once taken - Thanks Jean).
Thanks again,
Chris.
----------------------
Jean's post is below:
I posted a message to this group on 30 Aug 05 regarding problems I was
having creating publication-quality line graphs using thick lines (lwd>1)
and different line types in S-PLUS (original message pasted below). Thanks
to Patrick Burns, Tony Aldridge, Brian Ripley, Stephen Smith, Greg, and
Ricardo for their helpful responses (highlights of which are also pasted
below). I continued to experiment, and couldn't get anything to work
satisfactorily. I wrote to Insightful support, and learned of a workaround
from Kristina Kollen. Thanks, Kristina! If you're using Word 2000, the
solution is pretty straightforward, but if, like me, you're using Word 2003,
the workaround is a bit more cumbersome.
# My example graph #
wmf.graph(file="C:\\lineplot1.wmf", width=10, height=7.5)
par(mar=c(5, 5, 1, 1))
plot(0:1, 0:1, type="n", xlab="X Label", ylab="Y Label", cex=1.5)
for(i in 1:9) {
x <- c(1, 1, 1, 4, 4, 4, 7, 7, 7)[i]/10
y <- c(3, 6, 9, 3, 6, 9, 3, 6, 9)[i]/10
lines(c(x, x+0.2, x, x+0.2), c(y, y, y-0.2, y-0.2), lty=i,
lwd=3)
}
dev.off()
Word 2000:
(1) Create your graph in S-PLUS using wmf.graph().
(2) Bring the *.wmf file into Word (insert picture from file).
Note that I have not tested this workaround, because I don't have Word 2000.
Word 2003:
(1) Create your graph in S-PLUS using wmf.graph().
(2) Bring the *.wmf file into PowerPoint (insert picture from file).
(3) Ungroup the picture (convert to MSOffice drawing object).
(4) Fix changes to axis and tick labels ("ungrouping" rotates them).
(5) Save as *.emf file.
(6) Bring the *.emf file into Word (insert picture from file).
The PowerPoint steps are required because of a known bug in Word 2003 that
fails to distinguish between different line types with lwd>1 in *.wmf files
(they all look like solid lines). Kristina suggested that in order to avoid
making changes in PowerPoint, you can modify the graph by rotating the
y-axis labels and the tick labels. For example, either of the following
graphs will require no editing (step 4) in PowerPoint:
wmf.graph(file="C:\\lineplot2.wmf", width=10, height=7.5)
par(mar=c(5, 5, 1, 1))
plot(0:1, 0:1, type="n", xlab="X Label", ylab="", cex=1.5, yaxt="n")
mtext("Y Label", side=2, cex=1.5, line=2.6, at=0.5, srt=-90)
axis(2, cex=1.5, at=seq(0,1,by=0.2), srt=-90)
for(i in 1:9) {
x <- c(1, 1, 1, 4, 4, 4, 7, 7, 7)[i]/10
y <- c(3, 6, 9, 3, 6, 9, 3, 6, 9)[i]/10
lines(c(x, x+0.2, x, x+0.2), c(y, y, y-0.2, y-0.2), lty=i,
lwd=3)
}
dev.off()
wmf.graph(file="C:\\lineplot3.wmf", width=10, height=7.5)
par(mar=c(5, 5, 1, 1))
plot(0:1, 0:1, type="n", xlab="X Label", ylab="", cex=1.5, yaxt="n")
mtext("Y Label", side=2, cex=1.5, line=2.6, at=0.5, srt=-90)
axis(2, cex=1.5, las=1) #HORIZONTAL Y-AXIS TICK LABELS
for(i in 1:9) {
x <- c(1, 1, 1, 4, 4, 4, 7, 7, 7)[i]/10
y <- c(3, 6, 9, 3, 6, 9, 3, 6, 9)[i]/10
lines(c(x, x+0.2, x, x+0.2), c(y, y, y-0.2, y-0.2), lty=i,
lwd=3)
}
dev.off()
Thanks again for all the help. I've learned a lot, and while I hope that a
workaround will not be necessary in the future, I'm happy to have finally
found a way to create nice looking graphs in S-PLUS for use in Word.
JVA
|