XLABEL Plot X-axis Label Function

Section: Handle-Based Graphics


This command adds a label to the x-axis of the plot. The general syntax for its use is

or in the alternate form

  xlabel 'label'

or simply

  xlabel label

Here label is a string variable. You can also specify properties for that label using the syntax



Here is an example of a simple plot with a label on the x-axis.
--> x = linspace(-1,1);
--> y = cos(2*pi*x);
--> plot(x,y,'r-');
--> xlabel('time');

which results in the following plot.