On Tue, 28 Jan 2014, Leandro Zipitria wrote:
Thanks Ricardo,
I have reversed the axes:
<hansl>
matrix d_1 = kdensity(Water)
matrix d[,1] = d_1[,2]
matrix d[,2] = d_1[,1]
<hansl>
Now its ok. I think that the orders in the commmand kdensity are reversed,
or the gnuplot command use the information in the matrix that Gretl create
in reverse form (column 1 in the x axes and column 2 y axes, when it should
be otherwise).
The matrix itself is fine, the columns being x, f(x). The thing is that
gnuplot expects the y-axis variable(s) to be given first, then x (this is
in the help for the "gnuplot" command).
Maybe if you use "gnuplot" on a two-column matrix without giving a list
for the column order we should assume the matrix is in x, y order and
therefore reverse the columns for gnuplot's benefit? I'm not sure if that
would break any build-in uses of gnuplot in gretl.
Allin Cottrell