Am 13.03.2018 um 02:42 schrieb Allin Cottrell:
On Fri, 9 Mar 2018, Artur Tarassow wrote:
> Thank you for this updated script, Allin. It works fine. However, here
> (ubuntu 17.10.) the figure appears and actually stays permanently. I
> can't even close it without closing gretl. For the moment this doesn't
> bother me. And no, I did not find an option to avoid the figure
> showing up... :-/
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.
However, when run via the gretl GUI the cairoDevice variant fails.
Neither of the packages respects
your par() setting of "las=1" (axis labels always horizontal).
The graphics system seems to depend on a bunch of inscrutable global
variables over which the packages have an insecure degree of control.
Maybe it's unfair, but I have a sense of package writers not quite
knowing what they're doing in this area.
I've started to work a bit using R, and my impression is indeed that
there are packages out there which are just a black box. Also the
manuals are either not up to date or superficial.
As for the flashing (or persistent) X11 window showing a simplified
version of the plot we're trying to write to PNG, it seems to be a
feature of R that you can't turn that off. However, by sticking
"dev.off()" before the call to Cairo() I was able (on my system at any
rate) to get the X11 window just to flash, and not persist, when using
gretl_x11. (Using gretlcli it always just flashed.)
Thank you, Allin. The dev.off() before the call to Cairo() or also
plot() does the job! I think that using R for some advanced graphs by
means of the foreign-block is a nice feature. Still, gnuplot is also
quite powerful.
Best,
Artur