I created a polar plot with matplotlib. Additionally, I have a value that lays between 0 and 3. The value should determine the background color I set the color of the plot now like:
if 0.8 < x and x < 1.2:
color = 'white'
elif 1.2 < x and x < 1.4:
color = 'white'
etc...
and later:
ax.set_facecolor(color)
However, that's not very convenient.
My goal is that the color is white when its value is 1. For a value below 1, blue and for above 1, red. But continuously changing. Something like this gradient:

