James
James

Reputation: 25543

Fill a region on a graph with no outline?

I'd like to fill a region on a graph plotted with octave, without any outline:

The fill command accepts a color argument that it respects for the filled area, but it doesn't seem to accept the 'LineColor' property to change the color of the line it draws around the filled area...

e.g.

fill([1 2 3 3 2 1], [1 0.5 1 -1 -1 -1], [0.9,0.9,0.9]); # line is black
fill([1 2 3 3 2 1], [1 0.5 1 -1 -1 -1], [0.9,0.9,0.9], 'LineColor', 'r') # hangs

I'm using octave-3.4.0 on OS X.

Upvotes: 0

Views: 1134

Answers (1)

mike
mike

Reputation: 98

The patch command should do the job

verts = [0.2 0.4; ...
         0.2 0.8; ...
         0.8 0.8; ...
         0.8 0.4];
faces = [1  2  3 4];
p = patch('Faces',faces,'Vertices',verts,'FaceColor','b','EdgeColor','none');

Of course you could also place it in one line ... ;-)

Upvotes: 1

Related Questions