why does ax.fillbetween misbehave in the following condition

for recipe, group in df.groupby(‘Recepie’):
ax.fill_between(group[‘Time’],group[‘TPH’],1,alpha=0.35,color=color_map[recipe],where=group[‘TPH’] > 0,zorder = 1)
line2, = ax.plot(group[‘Time’],group[‘Average TPH’], alpha=1, linewidth=1, linestyle=‘–’, color=color_map[recipe],marker=“.”, markersize=2,drawstyle = ‘steps’)

This is my code for area fill
and these are the problems i am facing can i please get some help

What are the problems you are facing? You have just posted a few images with no indication of what might be wrong in them.

the white line in the picture represents a line plot and the problem is about the color which is going out of boundaries i.e. outside the white line.

I think that’s because you’ve told the line to use steps (which makes it no longer continuous), but you didn’t tell the fill_between to do so.

1 Like

Yep Works!!
thank You!