You have to tell matplotlib which color to use. To Use, for example, seaborn's default color palette:
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
ax=fig.add_subplot(111)
palette = itertools.cycle(sns.color_palette())
for f in files:
ax.scatter(args, color=next(palette))
The itertools.cycle makes sure we don't run out of colors and start with the first one again after using the last one.
Update:
As per @Iceflower's comment, creating a custom color palette via
palette = sns.color_palette(None, len(files))
might be a better solution. The difference is that my original answer at the top iterates through the default colors as often as it has to, whereas this solution creates a palette with as much hues as there are files. That means that no color is repeated, but the difference between colors might be very subtle.
scatteris aScalarMappablewhich means you can assign a scalar value to each marker which will than be used (along with a color map) to color each marker according to the scalar value. Given that, havingscatterparticipate in the color cycle logic seems silly/too fiddly. As a side note, unless you are varying the size of the markers, it is probably better to useplotwith no line (it will go faster). - tacaswell