GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • » Octave core
  • » by package
  • » alphabetical

This view

  • Original page
  • New address

GeezerVison is showing octave.sourceforge.io — Function Reference: line

Octave-Forge - Extra packages for GNU Octave
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code

Navigation

Operators and Keywords

Function List:

  • » Octave core
  • » by package
  • » alphabetical

C++ API

: line ()
: line (x, y)
: line (x, y, property, value, …)
: line (x, y, z)
: line (x, y, z, property, value, …)
: line (property, value, …)
: line (hax, …)
: h = line (…)

Create line object from x and y (and possibly z) and insert in the current axes.

Multiple property-value pairs may be specified for the line object, but they must appear in pairs.

If the first argument hax is an axes handle, then plot into this axis, rather than the current axes returned by gca.

The optional return value h is a graphics handle (or vector of handles) to the line objects created.

See also: image, patch, rectangle, surface, text.

Demonstration 1

The following code

 clf;
 line ([0 1], [0.8 0.8], "linestyle", "-", "color", "b");
 line ([0 1], [0.6 0.6], "linestyle", "--", "color", "g");
 line ([0 1], [0.4 0.4], "linestyle", ":", "color", "r");
 line ([0 1], [0.2 0.2], "linestyle", "-.", "color", "k");
 ylim ([0 1]);
 title ("line() with various linestyles");
 legend ('"-"', '"--"', '":"', '"-."', 'location', 'eastoutside');

Produces the following figure

Figure 1

Demonstration 2

The following code

 clf;
 x = 0:0.3:10;
 y1 = cos (x);
 y2 = sin (x);
 subplot (3,1,1);
  args = {"color", "b", "marker", "s"};
  line ([x(:), x(:)], [y1(:), y2(:)], args{:});
  title ("Test broadcasting for line()");
 subplot (3,1,2);
  line (x(:), [y1(:), y2(:)], args{:});
 subplot (3,1,3);
  line ([x(:), x(:)+pi/2], y1(:), args{:});
  xlim ([0 10]);

Produces the following figure

Figure 1

Package: octave

SourceForge.net Logo
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.