I am trying to make a horizontal barplot with just one bar. Here is sample code:
import matplotlib.pyplot as plt
plt.figure(figsize=(4, 1))
plt.barh(['my_value'], height =0.1, width=[-1,1], align='center')
plt.axvline(x=0.8, color='black')
How can I add a diverging color scheme/palette to it? Such that the color transitions from left to right smoothly. Solutions using Seaborn will work too.
CodePudding user response: