From: <hba...@ma...> - 2006-09-29 01:35:18
|
On Sep 28, 2006, at 5:47 AM, Bruno Picard wrote: > Fast: > Is there a plplot equivalent to the matlab function FILL?: > FILL Filled 2-D polygons. > FILL(X,Y,C) fills the 2-D polygon defined by vectors X and Y > with the color specified by C. The vertices of the polygon > are specified by pairs of components of X and Y. If necessary, > the polygon is closed by connecting the last vertex to the first. I believe that the function you seek is called plfill. An example using the PDL interface: #!/usr/bin/perl -w use strict; use PDL; use PDL::Graphics::PLplot; plspage(0, 0, 300, 300, 0, 0); plinit(); pladv(0); plvsta(); plwind(0.0, 4.0, 0.0, 4.0); plbox(0.0, 0, 0.0, 0, "bcnst", "bcnstv"); plcol0(2); my $x = pdl(1.0, 1.0, 2.0, 2.5); my $y = pdl(1.0, 2.2, 2.1, 1.0); plfill($x, $y); plend(); The polygon is automatically closed and is drawn with the current color. Also, note that the PDL interface automatically fills in the "n" in plfill(n,x,y). best, -Hazen |