Kenneth Cabrera wrote:
Hi S-Plus users:
I still have a problem with postcript() function:
If I execute this lines I obtain the graphics "problem.eps" graphic.
postscript("problem.eps")
barplot(rpois(5,2),names=rep("A very long label with tildes
mamá!",5),horiz=T)
dev.off()
As you see the "y" labels are cut.
But if I use the interactive mode I can arrange the problem, but I cannot
obtain the accents, like in "problem2.eps" file.
-- How can I modify the space for the "y" labels so the label will fit
using postscript() function?
-- How can I put colors using the postscript() function?
Again, thank you very much for your help.
1. You didn't give enough space for the ylabels.
2. See ?ps.options and use trellis.device(..., color = TRUE).
ps.options(paper = "a4", horizontal = TRUE,
colors = ps.colors.rgb)
trellis.device(postscript, file = "problem.eps", color = TRUE)
par(mar = c(5, 15, 3, 1))
barplot(rpois(5, 2),
names = rep("A very long label with tildes mamá!", 5),
horiz = TRUE, col = 10)
dev.off()
This works on S-PLUS 6.2 for Windows.
HTH,
--sundar
|