Trouble with set term in GNUPlot
by Logan Kelly
Here is the IRFplot function I wrote it works badly when pdf is replaced by png, but gives this error when the pdf terminal is used:
Couldn't recognize the image file format for file 'C:\Users\w3071048\AppData\Roaming\gretl\gretltmp.png'
function void IRFplot(matrix response, string graph_title, string output_file)
## Plot IRF's
#Make temporary file name. This file stores GNUPLOT script
scalar tmpfname = int(1000*muniform(1,1))
h = rows(response)
if $windows
sprintf tmpfile "@dotdir\\irf%d.gp", tmpfname
else
sprintf tmpfile "@dotdir/irf%d.gp", tmpfname
endif
outfile "@tmpfile" --write
printf "set term pdf font \"Sans,5\" size 275,200\n"
printf "set encoding utf8\n"
printf "set style line 1 lc rgb \"#ff0000\"\n"
printf "set style line 2 lc rgb \"#0000ff\"\n"
printf "set style line 3 lc rgb \"#00cc00\"\n"
printf "set style line 4 lc rgb \"#bf25b2\"\n"
printf "set style line 5 lc rgb \"#8faab3\"\n"
printf "set style line 6 lc rgb \"#ffa500\"\n"
printf "set style line 8 lc rgb \"#dddddd\"\n"
printf "set style increment user\n"
printf "set key left top\n"
printf "set xlabel 'periods'\n"
printf "set xzeroaxis\n"
printf "set title '@graph_title'\n"
printf "plot '-' using 1:2:3 notitle w filledcurve lt 8, 0 notitle w lines lt 0, '-' using 1:2 notitle w lines lt 1\n"
loop for i=1..h -q
printf "%d\t%g\t%g\n", i, response[i,2], response[i,3]
endloop
printf "e\n"
loop for i=1..h -q
printf "%d\t%g\n", i, response[i,1]
endloop
printf "e\n"
outfile "@tmpfile" --close
gnuplot --input="@tmpfile" --output=display
gnuplot --input="@tmpfile" --output="@output_file"
end function
12 years, 4 months
LaTeX command like GNUPlot
by Logan Kelly
Is there a script command the will compile a LaTeX file similar to the GNUPlot command, i.e.
gnuplot --input="@tmpfile" --output=display
Thanks,
Logan Kelly
12 years, 4 months
Script command to create a directory
by Logan Kelly
Are their OS commands available in the script directory? I need to make a new directory (In windows 7). Also, I would like to delete temporary files.
Thanks,
Logan Kelly
12 years, 4 months
Re: [Gretl-users] changing graph size
by Logan Kelly
The error message simply says that there is an error in the IRFplot function that I wrote for this project. I am using Windows 7 64 bit. I am not sure if GNUPlot is the one distributed with GRETL. I re installed GNUPlot after the first error to see if that was the problem, but no joy. should I uninstall GRETL and GNUPlot and then reinstall GRETL to verify I have the correct dist. of GNUPlot?
Thanks,
Logan
12 years, 4 months
changing graph size
by Logan Kelly
I need to change the size of a plot so that the text and line will be the correct size in my LaTeX document. I prefer to give LaTeX the correctly sized figure rather than scaling in LaTeX. I have writen a script that generates a GNUPLOT gp file. But the following command generates an error:
set term pdfcairo size 3in,4in
I can get
set term png size 3in,4in
but the final image quality is not good, i.e. it is not scalable like pdf or eps would be. I have also tried
set term post eps size 3in,4in
which also triggers an error.
I am processing the gp file in a script with the command
gnuplot --input="@tmpfile" --output="@output_file"
Thanks for any suggestions
Logan Kelly
12 years, 4 months
Re: [Gretl-users] Gretl-users Digest, Vol 67, Issue 8
by clarodina clarodina
Allin,
Tks
know for using the loop the d6 must be > d1 a
what if there is a d5 column and want to loop against the other columns d1
to d3 ? t these columns are < and are not process and the csv file must be
ajust the column d3 to the first column
is there a method to autothe adjustment?
and is there a setting for minimizing the output window rather having them
auto max on running the code?
12 years, 4 months
Feature Request: ODBC import as matrix
by Pindar
Hi there,
the ODBC import tool is a very powerful tool and I appreciate it much!
However, while working with it I came across some situations when the
option of importing as matrix would be nice
e.g. via data .... --odbc --matrix.
Here are my thoughts:
1) When working with multiple databases (with different structures) in
order to combine information the necessary steps are: work with
'nulldata' command, creating an appropriate observation index, use the
odbc import, change the series to a matrix, use 'nulldata --preserve'
and start with the next odbc import. This works fine. The point is, that
loops for subsequent sql statements over the whole script are impossible
e.g. when creating a panel.
2) If the observation string is cryptic like 1/1/FK/2012Q1 importing as
matrix would provide an easy way of using the obs-format option to
specify the rownames of the matrix and get without the need of a 'manual
intervention' the 'help information for the obs-string' into GRETL (
Matrix_Index_1stEntry London 1 ...). The usual series name would be
the colname.
3) For the right sizing of the index it is crucial to now the length of
an data imported via odbc. If this length is 'endogenous' a count sql
statement provides the needed information. Again if I want to work the
script automatically I need to import a whole series with only one value
and have to rescue this value as scalar (or matrix).
What do you think? Is it possible to add such an option without much
effort? Or should it better be an update to the 'mread' function?
Cheers
Leon
12 years, 4 months
Access elements of a list
by Logan Kelly
Is it possible to access elements of a list. I need the variable name-as a string-of the i_th element of a list. Something like
string variable_name = varnam(ylist[i])
Thanks,
Logan Kelly
12 years, 4 months
Re: [Gretl-users] Gretl-users Digest, Vol 67, Issue 6
by clarodina clarodina
Have a csv file having 25 columns d1 to d25
Trying to do a loop aginst the columns
scalar lo1=d1
scaler lo2=d2
.
.
.
.
.
scaler lo25=d25
Loop k=lo1..lo6
Loop m=lo6..lo12
but give a error
directly loop k=d1..d6 also give error
how to reference the columns
12 years, 4 months