piechart := proc(sectors) # sectors is the number of different sectors plotted local plot; plot := seq( # sequence of color plots plots[polygonplot]([[0,0],# first point of triangle # second point of triangle [cos(2*Pi*i/sectors),sin(2*Pi*i/sectors)], # third point of triangle [cos(2*Pi*(i+1)/sectors), sin(2*Pi*(i+1)/sectors)] ], color=COLOR(HUE,i/sectors) ), # finishes a single plot i=0..(sectors-1) # range of sequence ); plots[display]([plot]); end; # piechart