On Tue, 13 Mar 2018, Artur Tarassow wrote:
Am 13.03.2018 um 02:42 schrieb Allin Cottrell:
> The two packages you loaded in your script at
>
http://lists.wfu.edu/pipermail/gretl-users/2018-March/013035.html , namely
> Cairo and cairoDevice, are not complementary, they're competitors (not
> unusual for R packages). So I've tried each of them individually (script
> below). Both of them work when the script is run in gretlcli -- and in that
> context cairoDevice is better in one way: it respects your request to use
> the Times font, which is ignored by the Cairo package. [...]
Footnote after a little poking around. It seems that both of these
packages are out of date and redundant. This variant of your plot
function works just as well or better, using the built-in png()
function:
foreign language=R
HIST_R <- function(X, fname) {
H1 <- hist(X[,1])
H2 <- hist(X[,2])
H3 <- hist(X[,3])
dev.off()
png(filename=fname, width=600, height=600,
pointsize=24, type="cairo-png")
par(family="Times", las=1)
plot(H1, col=rgb(0,0,0,1/2), xlab="", main="")
plot(H2, add=T, col=rgb(0.5,0.5,0.5,1/2))
plot(H3, add=T, col=rgb(1,1,1,1/2))
dev.off()
0
}
end foreign
Allin