octave-maintainers
[Top][All Lists]
Advanced

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

Getting info back from gnuplot for auto range values


From: John W. Eaton
Subject: Getting info back from gnuplot for auto range values
Date: Wed, 20 Jun 2007 03:18:59 -0400

On 20-Jun-2007, Daniel J Sebald wrote:

| Attached is a patch illustrating how to get information back from
| gnuplot about auto axis ranging results if you are still interested.
| Rather than remove what would be extraneous code, I simply commented
| out the line of code that would use the octave computed settings.
| That way, this patch more clearly shows how to get the variables of
| interest.

I know this is possible, but I don't think it is the right approach to
use if we want compatibility (and I see no reason to be incompatible
when trying to implement Matlab-compatible graphics).

Here's an example of a problem with getting things like limits and
tick locations back from gnuplot.  Matlab can do this:

  figure ('visible', 'off');
  x = -pi:0.1:pi;
  plot (x, sin (x));
  get (gca (), 'xlim')  =>  [-4, 4]

If we want to emulate this by sending data to gnuplot and then asking
it for the limits, I think Octave will be slow to respond for plots
that contain many points, even when they are not displayed.

I also realize that Octave does not do this correctly now because it
skips the entire plotting process when the visible property is off.
Instead, it should be doing the computations on the data and possibly
setting some properties, but not asking the backend to render the
plot.

| It would be nice if the communication link could be done through a
| pipe or stream.  However, I didn't have much luck with the pipe()
| command.  First, it would have to be a pipe that has a file system
| name so that gnuplot could use "set print '|filename'".  Second,
| reading from the pipe created with pipe() seems to get stuck for me,
| i.e., put something into the WRITE_FD and try to read from READ_FD
| just hangs.

I'm not sure that pipe is the right function for what you want to do.
Look at the popen2.m function from Octave 2.1.73 for an example of how
it is intended to be used.

jwe


reply via email to

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