I have a plot with two histograms. However, it is difficult to tell which histogram on the plot is coming from the first set of data and which graphs the second set of data.
There exists a colormap for this specific purpose - lines
(Introduced before R2006a).
Here's what lines.m
says:
%LINES Color map with the line colors.
% LINES(M) returns an M-by-3 matrix containing a "ColorOrder"
% colormap. LINES, by itself, is the same length as the current
% colormap. If no figure exists, MATLAB uses the length of the
% default colormap.
If you open the documentation of lines, you can see a preview image that looks very much like what appears in rayryeng's answer:
Thus, as long as you're using the default colormap
, to know the colors of the first n
lines, all you need to do is call lines(n)
.