Fill area of chart using matplotlib in python

Поделиться
HTML-код
  • Опубликовано: 12 июл 2022
  • import matplotlib.pyplot as plt
    y = [1,2,3,4,5,6]
    x = [1,2,1,2,3,2]
    x1 = [0,1,0,1,2,1]
    x2 = [2,3,2,3,4,3]
    plt.plot(x,y)
    plt.fill_betweenx(y,x1,x2, color="lightblue", alpha=0.5)
    plt.axvspan(2,3, color="red", alpha=0.2)
    plt.axhspan(3,5, color="green", alpha=0.2)
    plt.show()
  • НаукаНаука

Комментарии • 1

  • @bladdra
    @bladdra Год назад +1

    Thanks for your video, I was having an issue with fill_between method and I addressed it with axhspan method . 👍