help-octave
[Top][All Lists]
Advanced

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

Re: Bug in script for plotting


From: Stefan Neumann
Subject: Re: Bug in script for plotting
Date: Fri, 8 Feb 2013 13:43:49 +0100

Hi Ben,


this error is rather arbitrary. I have unpatched /usr/local/share/octave/3.6.3/m/plot/private/__go_draw_axes__.m (taken out the space before "unset obj") and the error does not occur with the script I am using.

Yesterday it did (really!)



Anyway, your script works fine for reproducing, see here:

octave:15> plot (rand (3))
octave:16> surf (peaks ())
octave:17> contour (peaks ())

gnuplot> nset view;
         ^
         line 0: invalid command

octave:18>
gnuplot> nset obj 1;
         ^
         line 0: invalid command



But, as I said, it is quite arbitrary. You have to paste alle three commands into the octave commandline at the same time.

Cut+Paste, one line per command, just as in your example.

Not: one line separated by ";"
Not: The three command in a script, this will also not show the error.



My config:
----------------
- ubuntu 12.04
- octave 3.6.3 compiled from source
- gnuplot Version 4.4 patchlevel 3 (that is the newest version with ubuntu 12.04, no further update available)

- remote access to this PC  with ssh -X (ssh-forwarding)
-- the graph appears on the local PC
-- the local computer also runs ubuntu 12.04 and octave 3.6.3 (from source) and gnuplot 4.4/level 3, I assume this is irrelevant because the graph is generated on the remote PC and then sent to the local x-server

I have been watching this error for some time now. Sometimes it occurs, then it disappears for days, then reappears. If I had to guess I would say that it has something to do with the interaction of fputc() and and the OS and the pipe to gnuplot.

Maybe related to other I/O-activity?


stn








2013/2/8 Ben Abbott <address@hidden>
On Feb 7, 2013, at 5:28 PM, stn wrote:

> Hi,
>
> this is kind of irritating. It has also probably been discussed before.
>
>
> The plot-command works fine, the plot appears as expected, but on the terminal there is a message
>
> gnuplot> nset obj 1;
>          ^
>          line 0: invalid command
>
>
> After lots of googling and some grepping I found this line in /usr/local/share/octave/3.6.3/m/plot/private/__go_draw_axes__.m
>
> Only there it says "unset obj". More specifically it says "fputs (plot_stream, "unset obj 1; \\\n");"
>
> The problem can be solved by replacing every occurence of "unset obj" in the script with " unset obj".
>
> It would appear that the function fputs() does not work correctly and truncates the first character of this string. The solution mentioned above simply adds a space-character, that is then truncated.
>
> I would like to suggest checking the matter.
>
> Best regards, stn

I've seen this mentioned before, but I do not get this error.  For example, each of the following work for me.

        plot (rand (3))
        surf (peaks ())
        contour (peaks ())

I'm using gnuplot 4.6 patchlevel 1

Can you tell us what version of gnuplot you are using (just in case that is involved in some way).  Also, can you provide a short script that produces the error for you so that we may try to duplicate it?

Ben




reply via email to

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