help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __gnuplot_set__


From: etienne
Subject: Re: __gnuplot_set__
Date: Sat, 31 Jan 2009 15:55:19 -0800
User-agent: Internet Messaging Program (IMP) H3 (4.3)


  Hi again,

if you take the path to speak directly to Gnuplot, maybe you will find useful the raw Octave-to-Gnuplot interface that I wrote. You can get it at:

  http://users.isr.ist.utl.pt/~etienne/code/code.html#OctaveGnuplot

  Hth,

  Etienne

Quoting Dieter Jurzitza <address@hidden> (Sat, 31 Jan 2009 08:46:04 +0100):

Hi Marize,
the best way to do this is the system command and make yourself independent of
the gnuplot interface of octave. Thereby you can use full gnuplot
functionality without putting effort in an in-between layer interfacing
between octave and gnuplot.

***************************************************************************
A=zeros(1024,1);
for i=1:1024
A(i)=sin(2.0*pi*(i-1)/1024*10);
endfor

out=fopen("myfile", "w");
for i=1:1024
fprintf(out, "%10.3f %10.3f\n", (i-1)/1024, A(i));
endfor
fclose (out);

script=fopen("myfile.plt", "w");
fprintf(script, "set xrange[0:1]\n");
fprintf(script, "set yrange[-1:1]\n");
fprintf(script, "set terminal postscript enhanced color solid lw 2\n");
fprintf(script, "set output \"myfile.ps\"\n");
fprintf(script, "plot \"myfile\" w l\n");
fprintf(script, "set output\n");
fclose (script);
system("gnuplot myfile.plt");
****************************************************************************

and you end up with a graph in "myfile.ps" in postscript format. Expanding
this example (see i. e. /usr/share/doc/packages/gnuplot/doc/ps_guide.ps if
you are on linux) enables you to set nice fonts, you can use all commands of
gnuplot easily and if you need to repeat such graphs you could define an
octave-routine that does most things automatically.

If you convert the above genreated function into a pdf-file you can smoothly
integrate it into i. e. latex documents. Nevertheless you can use jpeg format
as easy modifying the example above accordingly.

Contact me if you need further support in this regard - best if you are using
linux, that is where I have the most experience in this regard (and several
tools making live easier).

Hope this helps,
take care



Dieter Jurzitza
--
-----------------------------------------------------------

                               |
                                \
                 /\_/\           |
                | ~x~ |/-----\   /
                 \   /-       \_/
  ^^__   _        /  _  ____   /
 <°°__ \- \_/     |  |/    |  |
  ||  ||         _| _|    _| _|

if you really want to see the pictures above - use some font
with constant spacing like courier! :-)
-----------------------------------------------------------Am Samstag, 31.
Januar 2009 03:18:23 schrieb Marize Simoes:
Hi

How do I make gnuplot calls using octave?
****

_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave




--
http://www.isr.ist.utl.pt/~etienne

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]