Octave itself can generate figures by means of gnuplot but possibilities are limited. You can also export data to temporary file, and use gnuplot externally to get the desired figure and use all capabilities of gnuplot, but this method is unnecessarily complicated. You can use gps to do all this things directly in the octave script. It is sort of Octave-to-gnuplot interface.
Gps creates hidden temporary files with plot data, sets gnuplot's pslatex terminal, plots the figure, and runs latex to get the final figure with all latex specialties in legends you can think off.
The only problem of GnuPlot Stream was it didn't allow to set dimensions of the paper, the font size and some other details. Therefore I changed it a little.
I added the possibility to call the gps in the following way:
gps("psp", root-name, plot settings)
The first argument is always "psp", the second one is the root of figure filename without extension (the extension ".ps" is added automatically by gps). Third argument is pslatex gnuplot terminal settings.
Following command creates file fig5.ps, standard gnuplot settings, width of the image is 14 cm, height 5 cm, fontsize 6.
gps("psp","fig5","size 14cm,5cm 6")
To create file fig6.ps with oldstyle setting of gnuplot, pslatex terminal, use:
Gnuplot's pslatex terminal gives following possibilities:
(rotate | norotate)
(oldstyle | newstyle)
(auxfile | noauxfile)
(level1 | leveldefault)
(color | colour | monochrome)
(solid | dashed)
(dashlength | dl <DL>)
(linewidth | lw <LW>)
(rounded | butt)
(clip | noclip)