Reputation: 1787
I checked this link to understand what 'c' means by c=y_train
. There is an answer that says y_train data will be used to dictate the color. I could not understand this statement.
There is some information in this documentation link but hard to understand.
Upvotes: 2
Views: 2927
Reputation: 2110
As stated in the documentation of matplotlib you linked c is the parameter for the color of the scatter points.
c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs
In combination with colormap this will, in your case when c = y_train (the label or ground truth of your data), color your datapoints according to there class (which type of iris flower for the iris data set).
Upvotes: 3