From: Simon on
I am trying to draw bars with the 'fill' function from an array containing my data.

An example of my data:
X=[1,2; 3,4; 5,6; 7,8; 9,10]

next I draw the data as follows
fill([X(:,1) X(:,2) X(:,2) X(:,1)], [1 1 0 0], 'r')

This works great, however, when my data is only 4 in length
for example:
fill([X(1:4,1) X(1:4,2) X(1:4,2) X(1:4,1)], [1 1 0 0], 'r')
I do not get the bars I expect but triangles.

If the data array is more or less then 4 it works perfectly. What am I doing wrong?