help-octave
[Top][All Lists]
Advanced

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

xlabel


From: Henry F. Mollet
Subject: xlabel
Date: Sat, 27 Mar 2010 19:15:25 -0700
User-agent: Microsoft-Entourage/11.1.0.040913

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> 


Attachment: Figure 1.pdf
Description: Binary data


reply via email to

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