I have an NLTK function that creates a AxesSubplot like this:
# Names ending letters frequency
import nltk
import matplotlib.pyplot as plt
cfd = nltk.ConditionalFreqDist(
(fileid, name[-1])
for fileid in names.fileids()
for name in names.words(fileid))
plt.figure(figsize=(12, 6))
cfd.plot()
And I would like to change the colors of the lines individually. Most solutions I see online generate each line individually with a separate plot line. However the matplotlib .plot()
method is called within the ConditionalFreqDist .plot()
. Is there an alternative way I can change the colors of the lines? I'd like the female line to be blue and the male line to be green.