# MATLAB: Get next plot color

color

When using the function plot with hold set to 'all', each call to plot uses the successive entry in the ColorOrder property of the current axes. Is there a way to find out what is the color the next call to plot will use, if it is not known how many calls to plot have already been executed?
In other words, here is an example to clarify my question: plot(x,bob) hold all plot(x,garry) … (unknown number of calls to plot)
What will be the color of the next plot?
Thanks, David

colorOrder = get(gca, 'ColorOrder');plot(1:10, 'Color', colorOrder(mod(length(get(gca, 'Children')), size(colorOrder, 1))+1, :))