I'm using Matplotlib and Pandas to plot x by y, grouped by z. So I have the following:
x = df['ColumnA']
y = df['ColumnB']
fig, ax = plt.subplots(figsize=(20, 10))
for key, grp in df.groupby(['ColumnC']):
plt.plot(grp['ColumnA'], grp['ColumnB'].rolling(window=30).mean(), label=key)
I also want to highlight 2 specific values from the total amount of values that will be plotted:
ax.legend(('Value1', 'Value2'))
plt.show()
This works fine. I just have the 2 values in my legend, but all values are actually plotted. What I actually want, is to be able to specify the colors for the 2 Values above. i.e. red and blue and have all the other values from Column C show on the plot as one color. The objective is to highlight how Value 1 & 2 are performing compared to everything else.
