help-octave
[Top][All Lists]
Advanced

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

Re: xlabel


From: Ben Abbott
Subject: Re: xlabel
Date: Sat, 27 Mar 2010 22:51:39 -0400

On Mar 27, 2010, at 10:15 PM, Henry F. Mollet wrote:

> I'm trying to update old scripts that use gset. I'm using Octave
> 3.2.2/Gnuplot4.25/AquaTerm on Mac with OS 10.4.11. I've tried the example
> given with doc xlabel but have problems with the xlabel and also the
> position of the title. Result of example is attached.
> 
> I've tried suggestions by Ben in an answer to the same question dated June
> 29, 2009 but have the same problems with xlabel after changing
> defaultposition or changing to x11.
> Henry
> 
> -3.2.2:28> doc xlabel
> 
> File: octave.info,  Node: Plot Annotations,  Next: Multiple Plots on One
> Page, \
> Prev: Three-Dimensional Plotting,  Up: Plotting Basics
> 
> 15.1.3 Plot Annotations
> -----------------------
> 
> You can add titles, axis labels, legends, and arbitrary text to an
> existing plot.  For example,
> 
>     x = -10:0.1:10;
>     plot (x, sin (x));
>     title ("sin(x) for x = -10:0.1:10");
>     xlabel ("x");
>     ylabel ("sin (x)");
>     text (pi, 0.7, "arbitrary text");
>     legend ("sin (x)");
> 
>   The functions `grid' and `box' may also be used to add grid and
> border lines to the plot.  By default, the grid is off and the border
> lines are on.
> 
> Entering one command after the other:
> 
> octave-3.2.2:5>      x = -10:0.1:10;
> octave-3.2.2:6>      plot (x, sin (x));
> octave-3.2.2:7>      title ("sin(x) for x = -10:0.1:10");
> octave-3.2.2:8>      xlabel ("x");
> error: invalid use of script in index expression
> octave-3.2.2:8>      ylabel ("sin (x)");
> octave-3.2.2:9>      text (pi, 0.7, "arbitrary text");
> octave-3.2.2:10>      legend ("sin (x)");
> octave-3.2.2:11> 
> 
> Suggestion based on answer by Ben to the same question:
> octave-3.2.2:19> close all
> octave-3.2.2:20> set (0, "defaultaxesposition", [0.13, 0.13, 0.775, 0.795])
> octave-3.2.2:21> plot (1:10)
> octave-3.2.2:22> xlabel ("my xlabel")
> error: invalid use of script in index expression
> octave-3.2.2:22> close all
> octave-3.2.2:23> setenv ("GNUTERM", "x11")
> octave-3.2.2:24> plot (1:10)
> octave-3.2.2:25> xlabel ("my xlabel")
> error: invalid use of script in index expression
> octave-3.2.2:25> 

Henry,

So far I've been unable to locate where the error you see originates.

>From what you've presented, I infer that something may be wrong with your 
>xlabel script.

What you do get when you type...

        ls(cstrcat('-l ',which('xlabel')))

If the date is more recent than 2009-07-29 then it may have been modified ... 
Did you download the Octave binary from SourceForge, or build it from sources 
using Fink or MacPorts?

Ben



reply via email to

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