Plot size
by Riccardo (Jack) Lucchetti
I'm writing some code that produces plots. It would be very useful,
given the type of plot I need, to be able to tweak its size. This is
currently impossible with the gnuplot or plot commands, but one can
overcome this limitation by embedding the plot inside a gpbuild block, as in
<hansl>
open denmark
gpbuild foo
gnuplot LRM LRY
end gpbuild
gridplot foo --height=200 --output=display
</hansl>
It works, but it's a bit of a hack.
I think I remember that the requirement of having a fixed sized output
for gnuplot was linked to the necessity of being able to do all the
clever things we have for tweaking the plot via our GUI tool. I think
you need that for zooming too. There may be more, I can't remember offhand.
I was thinking: how about enabling the --width and --height option for
plot/gnuplot, stating clearly in the documentation that the resulting
plot won't be editable, zoomable, etc?
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------
1 day, 11 hours
seq() final value question
by Sven Schreiber
Hi,
I'm wondering whether the following end of the sequence is intended:
<hansl>
m = seq(0.01, 0.99, 0.01) # expect up to 0.99
eval nelem(m) # get only 98
eval min(m) # 0.01 (OK)
eval max(m) # 0.98 ?
</hansl>
Of course, floats can be tricky and I guess that could be the reason,
namely that the 99th member's representation could be a tiny bit larger
than 0.99 and thus wouldn't be accepted anymore.
However, checking with an explicit summing loop at the hansl level I do
get the pretty exact 0.99000000 end value. Or was the number of shown
digits simply not big enough? Or is there a difference between the C
level and the hansl level in such a context?
BTW, I know that I can do m = seq(1, 99, 1) / 100 instead and so I get
what I want. That's not the point right now.
thanks
sven
1 week
hallucinations of "pkg query"
by Sven Schreiber
Hi,
I'm running into the following problem. For a certain local function
package, "pkg query <x>" reports a file location wich is not correct,
because I deliberately moved and/or renamed the file. But "pkg unload
<x>" fails, I guess because the package doesn't really exist anymore.
Note that the package does not appear (anymore) in the window with the
list of installed packages, and rightly so.
So I'm stuck with a situation where the $result bundle from "pkg query
... --quiet" is not empty, so gretl believes something is there, but
this is misleading and destroying my code logic.
The problem seems to persist after doing "clear", but everything
apparently returns to normal after a restart. This is 2026d on Windows.
Not a super big problem in standard gretl usage, but a bit annoying when
upgrading/testing packages.
thanks
sven
1 week, 2 days
typename() null problem
by Sven Schreiber
Hi,
here's the problem copied from the gretl console:
? matrices M = defarray(ones(1), zeros(1))
? = typename(M)
matrices
? bundle b = _(M)
? = typename(b.M)
null
? = typestr(typeof(b.M))
array
The problem is the "null" output from the second typename call, the rest
is fine. This is causing a fatal problem in certain applications of the
parallel_func package (but not with the sample script). Since that
package hasn't been changed in two years, I'm inclined to think that
this is "new" gretl behavior -- and indeed, I'm seeing this only with
gretl >= 2026c.
Looks like there's another mildly nasty bug which we didn't undo with 2026d.
I guess it would be possible for an updated parallel_func to work around
this, temporarily for people using gretl 2026c and 2026d. Would
something like that make sense? Don't know what other packages are
affected, using typename() on nested stuff inside a bundle.
thanks
sven
1 week, 3 days