Plotting polynomials roots
I know that you subsequently posted c++ code for this and that post has answers, one of which is accepted. 

I did notice that the code above references the global variable colours. This may be seen as bad programming style because it can cause side effects that may be challenging to detect. Alternatively, function parameters could be used, or else a  class with a class/data/instance member.