12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

fillIf C is a row vector, fill generates flat-shaded polygons where each elementdetermines the color of the polygon defined by the respective column of the Xand Y matrices. Each patch object’s FaceColor property is set to 'flat'. Eachrow element becomes the CData property value for the nth patch object, wheren is the corresponding column in X or Y.If C is a column vector or a matrix, fill uses a linear interpolation of the vertexcolors to generate polygons with interpolated colors. It sets the patch graphicsobject FaceColor property to 'interp' and the elements in one column becomethe CData property value for the respective patch object. If C is a column vector,fill replicates the column vector to produce the required sized matrix.ExamplesCreate a red octagon.t = (1/16:1/8:1)'*2*pi;x = sin(t);y = cos(t);fill(x,y,'r')axis square10.80.60.40.20−0.2−0.4−0.6−0.8−1−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1See Alsoaxis, caxis, colormap, ColorSpec, fill3, patch2-193

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!