help-octave
[Top][All Lists]
Advanced

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

Re: Axes object in Octave 2.9.12 and other plotting questions


From: Przemek Klosowski
Subject: Re: Axes object in Octave 2.9.12 and other plotting questions
Date: Fri, 15 Jun 2007 09:17:23 -0400 (EDT)

   No problem. However but tick marks are supported in *gnuplot*. How can I
   bypass all the set functions in octave 2.9.12 (gset is no longer supported)

Well, one way to get direct Gnuplot support is to use Gnuplot
directly.  You give up compatibility with the Matlab way of doing
graphics, but then again, if you like gnuplot you can use it from
Matlab as well.

Specifically, you can write out x-y  data  to a file, and then write
out gnuplot commands

    x=[0:.1:2*pi];
    f=fopen("test",'w');
    fprintf(f,"plot '-' with linespoints\n");
    fprintf(f,"%f\n",sin(x));
    fprintf(f,"end\npause -1\n");
    fclose(f);
    system('gnuplot test');

note that combining data and commands in this way disables mouse zoom-in
(there's no way to reread inline data), so it's probably better this way:

    fd=fopen("test.dat",'w');
    fc=fopen("test.cmd",'w');
    fprintf(fc,"plot 'test.dat' with linespoints\n");
    fprintf(fd,"%f\n",sin(x));
    fprintf(fc,"pause -1\n");
    fclose(fc);
    fclose(fd);
    system('gnuplot test.cmd');



reply via email to

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