help-octave
[Top][All Lists]
Advanced

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

problem resolved! RE: help on plot in octave


From: Jason Ding
Subject: problem resolved! RE: help on plot in octave
Date: Sat, 20 Jun 2009 01:56:27 -0700


-----Original Message-----
From: Carlo de Falco [mailto:address@hidden 
Sent: Saturday, June 20, 2009 12:28 AM
To: Jason Ding
Cc: Ben Abbott; address@hidden
Subject: Re: help on plot in octave


On 20 Jun 2009, at 06:38, Jason Ding wrote:

>
>
> -----Original Message-----
> From: Ben Abbott [mailto:address@hidden
> Sent: Friday, June 19, 2009 6:41 PM
> To: Jason Ding
> Cc: address@hidden
> Subject: Re: help on plot in octave
>
>
> On Jun 19, 2009, at 9:28 PM, Jason Ding wrote:
>>
>> -----Original Message-----
>> From: Ben Abbott [mailto:address@hidden
>> Sent: Friday, June 19, 2009 5:42 PM
>> To: Jason Ding
>> Cc: address@hidden
>> Subject: Re: help on plot in octave
>>
>>
>> On Jun 19, 2009, at 8:11 PM, Jason Ding wrote:
>>
>>>
>>> On Jun 19, 2009, at 6:31 PM, Jason Ding wrote:
>>>
>>>> Hi, All,
>>>>
>>>> I installed both gnuplot and Octave. Gnuplot and octave work well
>>>> separately.  When I tried to use the "plot" function in octave, I
>>>> got the following errors after seeing an empty figure window  
>>>> popping
>>>> up. Can anyone have the similar experience? Or what may cause this?
>>>>
>>>> Thanks, a lot.
>>>>
>>>>
>>>> if (exists("GPVAL_TERM")) print GPVAL_TERM; else print NaN
>>>>                  ^
>>>>       line 0: invalid expression
>>>>
>>>> error: Invalid call to strcat.  Correct usage is:
>>>>
>>>> -- Function File:  strcat (S1, S2, ...)
>>>
>>>
>>> Please include the OS your are using as well as the version of  
>>> Octave
>>> and gnuplot.
>>>
>>> The first error, complaining of GPVAL_TERM, appears to be from
>>> gnuplot. The "strcat" error is from Octave (but is only occurring
>>> because of the 1st error).
>>>
>>> Assuming your Octave version is > 3.0 and your gnuplot is 4.2.2 or
>>> more recent, it is likely that you don't have a default terminal  
>>> type
>>> set for gnuplot.
>>>
>>> You'll want to set the GNUTERM environment variable. For Linux it
>>> should be set to "x11" or "wxt". For Mac OSX it can be set to "x11"
>>> or
>>> "aqua". For Windows  (I think) it can be set to "windows" and if you
>>> have x11 installed, then "x11" should also work (I'm guessing as I
>>> haven't used windows in years).
>>>
>>> Ben
>>>
>>>
>>> Ben,
>>>
>>> Thanks for your reply. Here is  more info about OS, GNUplot and
>>> octave.
>>> Terminal type is set to x11, gnuplot is 4.0 and octave is 3.2.0.
>>>
>>> Thanks,
>>> Jason
>>>
>>> OS:
>>>
>>> Linux version 2.6.18-92.el5 (address@hidden) (gcc
>>> version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Tue Jun 10  
>>> 18:51:06
>>> EDT 2008
>>>
>>> GNUPLOT:
>>>
>>>   Version 4.0 patchlevel 0
>>>      last modified Thu Apr 15 14:44:22 CEST 2004
>>>      System: Linux 2.6.18-92.el5
>>>
>>>      Copyright (C) 1986 - 1993, 1998, 2004
>>>      Thomas Williams, Colin Kelley and many others
>>>
>>>      This is gnuplot version 4.0.  Please refer to the documentation
>>>      for command syntax changes.  The old syntax will be accepted
>>>      throughout the 4.0 series, but all save files use the new
>>> syntax.
>>>
>>>      Type `help` to access the on-line reference manual.
>>>      The gnuplot FAQ is available from
>>>              http://www.gnuplot.info/faq/
>>>
>>>      Send comments and requests for help to
>>>              <address@hidden>
>>>      Send bugs, suggestions and mods to
>>>              <address@hidden>
>>>
>>>
>>> Terminal type set to 'x11'
>>>
>>>
>>> Octave:
>>>
>>> GNU Octave, version 3.2.0
>>> Copyright (C) 2009 John W. Eaton and others.
>>> This is free software; see the source code for copying conditions.
>>> There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
>>> FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
>>>
>>> Octave was configured for "x86_64-unknown-linux-gnu".
>>>
>>> Additional information about Octave is available at
>>> http://www.octave.org.
>>>
>>> Please contribute if you find this software useful.
>>> For more information, visit http://www.octave.org/help-wanted.html
>>>
>>> Report bugs to <address@hidden> (but first, please read
>>> http://www.octave.org/bugs.html to learn how to write a helpful
>>> report).
>>>
>>> For information about changes from previous versions, type `news'.
>>>
>>> octave:1>
>>>
>>
>> It appears that the problem may be that you are running a rather old
>> version of gnuplot.
>>
>> Can you upgrade to a version more recent than 4.2.2 (the latest
>> release if 4.2.5).
>>
>> Ben
>>
>>
>> Ben,
>> Thanks for the suggestion. I installed gnuplot4.2.5 and tested it ok.
>> Then I changed the gnuplot_binary to this new gnuplot4.2.5 binary.  
>> Run
>> octave3.0, I got the same errors as before but I did get a warning
>> saying gnuplot_binary is not a built-in variable.
>>
>> Thanks,
>> Jason
>>
>> The following screen captures for running new gnuplot and octave:
>>
>> address@hidden bin]$ ./gnuplot
>>
>>       G N U P L O T
>>       Version 4.2 patchlevel 5
>>       last modified Mar 2009
>>       System: Linux 2.6.18-92.el5
>>
>>       Copyright (C) 1986 - 1993, 1998, 2004, 2007 - 2009
>>       Thomas Williams, Colin Kelley and many others
>>
>>       Type `help` to access the on-line reference manual.
>>       The gnuplot FAQ is available from http://www.gnuplot.info/faq/
>>
>>       Send bug reports and suggestions to
>> <http://sourceforge.net/projects/gnuplot>
>>
>>
>> Terminal type set to 'x11'
>>
>> address@hidden ~]$ octave
>> GNU Octave, version 3.2.0
>> Copyright (C) 2009 John W. Eaton and others.
>> This is free software; see the source code for copying conditions.
>> There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
>> FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
>>
>> Octave was configured for "x86_64-unknown-linux-gnu".
>>
>> Additional information about Octave is available at
>> http://www.octave.org.
>>
>> Please contribute if you find this software useful.
>> For more information, visit http://www.octave.org/help-wanted.html
>>
>> Report bugs to <address@hidden> (but first, please read
>> http://www.octave.org/bugs.html to learn how to write a helpful
>> report).
>>
>> For information about changes from previous versions, type `news'.
>>
>> warning: gnuplot_binary is no longer a built-in variable; please read
>> the NEWS file or type `news' for details
>> gnuplot_binary = /home/jding/usr/bin/gnuplot
>> octave:1>
>
> Jason, please reply at the bottom to allow new comers to follow along
> more naturally.
>
> Notice the warning regarding the "gnuplot_variable".
>
> Please type the following at Octave's prompt to confirm Octave sees
> gnuplot 4.2.5
>
>       __gnuplot_version__
>
> If you have 4.2.5 installed correctly, you will see ...
>
>       ans = 4.2.5
>
> Ben
>
> I checked __gnuplot_verion__ and it is still 4.0. How can I let octave
> use the 4.2.5 one instead of 4.0? I can run 4.2.5 independently and
> 4.2.5 is installed after octave 3.2.0.
>
>
> Thanks,
>
> Jason


Jason,

>> warning: gnuplot_binary is no longer a built-in variable; please read
>> the NEWS file or type `news' for details
>> gnuplot_binary = /home/jding/usr/bin/gnuplot
>> octave:1>

This warning tells you that gnuplot_binary is not a built-in variable  
so setting

gnuplot_binary = something

will not have the effect you expect.
Infact, if you type help gnuplot_binary you get

 >> help gnuplot_binary
`gnuplot_binary' is a function from the file /Applications/Octave.app/ 
Contents/Resources/share/octave/3.2.0/m/plot/gnuplot_binary.m

  -- Loadable Function: VAL = gnuplot_binary ()
  -- Loadable Function: OLD_VAL = gnuplot_binary (NEW_VAL)
      Query or set the name of the program invoked by the plot command.
      The default value `\"gnuplot\"'.  *Note Installation::.

please try

gnuplot_binary ("/home/jding/usr/bin/gnuplot")

instead.
c.


I can plot correctly in octave now! Thanks for all the help. I added the
following line in the octaverc file located in
/share/octave/3.2.0/m/startup

gnuplot_binary("/home/jding/usr/bin/gnuplot")

Octave will point to the right gnuplot (4.2.5 for my case) when it is
invoked. 

In summary, Octave 3.2.0 doesn't work with gnuplot 4.0 and it can work
with gnuplot 4.2.5. gnuplot_binary is a function instead of a variable
for octave 3.2.0

Thanks,

Jason





reply via email to

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