gnuplot 3.6beta

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

gnuplot 3.6beta

Nils Naumann
-----BEGIN PGP SIGNED MESSAGE-----

Hallo,

how can I access the new features of gnuplot 3.6beta from within
octave?  The gplot command seems not to accept the new keywords `axes'
and `smooth'.  Only multiplot is supported. If I need a 2'nd y scale,
I have to save the data into a file and drawing the diagrams directly
with gnuplot.

Nils

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBM3M6j0ngatguDh05AQGJOAP9HP0ubblyFiodympW9vxv6Dj3vK6Wo26T
0cmzCU0b9WsMrIR316rmpf/Yo1wAdDp3UX+0OM5QQbgMqLcJiPNf5oH6ukrtLxg2
a6++E7c6ju2H1wPU4E9bGuQKU4sdgfT9wco5DMjDQ1GlfdZEKZIcqqmBPfialgoT
4cfqBkuvSxU=
=A65g
-----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

gnuplot 3.6beta

John W. Eaton-6
On  9-May-1997, Nils Naumann <[hidden email]> wrote:

| how can I access the new features of gnuplot 3.6beta from within
| octave?  The gplot command seems not to accept the new keywords `axes'
| and `smooth'.  Only multiplot is supported. If I need a 2'nd y scale,
| I have to save the data into a file and drawing the diagrams directly
| with gnuplot.

The new keywords won't with Octave's gplot command until someone fixes
Octave to also understand them.

The problem is that Octave parses the gplot command so that things
like

  foo = rand (51, 1);
  lo = -5;
  hi = 55;
  line_type = 4;
  gplot [lo:hi] foo with lines line_type

will work without having to use various combinations of eval(),
sprintf(), etc.  For example, if Octave did not parse the command to
evaluate the appropriate expressions, but just sent gplot's arguments
to gnuplot through a pipe, you would have to write something like

  file = tmpnam ();
  eval (sprintf ("save -ascii %s foo", file));
  eval (sprintf ("gplot [%d:%d] %s with lines %d", lo, hi, file, line_type);

which seems rather inconvenient.  Also, it would leave a junk file in
/tmp unless you arranged to clean it up yourself.

If you are willing to do the extra work, you can use whatever gnuplot
features you like.  For example:

  plot_stream = popen ("gnuplot", "w");
  foo = rand (51, 2);
  lo = -5;
  hi = 55;
  file = tmpnam ();
  eval (sprintf ("save -ascii %s foo", file));
  fprintf (plot_stream, "set y2tics\n");
  fprintf (plot_stream,
           sprintf ("plot [%d:%d] '%s' u 1 axes x1y1, '%s' u 2 axes x1y2\n",
                    lo, hi, file, file));
  fflush (plot_stream);

It would be nice if Octave could automatically use whatever features
are availble in gnuplot, but I don't see a way to make that happen.
If anyone else does have a reasonable solution to the problem, send
me mail (working code would also be helpful!).

Thanks,

jwe