Python Forum
How to fill between the same area with two different colors
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to fill between the same area with two different colors
#1
import matplotlib.pyplot as plt
x1 = [1,2,3,4,5,]
y1 = [2,3,4,5,6]
y2 = [6,7,8,9,10]

x2 = [6,7,8,9,10]
y11 = [2,3,4,5,6]
y22 = [10,11,12,12,5]

instead of plottig them separately like this

plt.fill_between(x1,y1,y2, c='g')
plt.fill_between(x2,y11,y22, c='r')

I want to be able to combine them and plot with two different colors like this

plt.fill_between([x1:x2], [y1:y2], [y11:y22], c='g', c='r')
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Count image's colors very fast flash77 18 1,299 Mar-05-2024, 06:12 PM
Last Post: deanhystad
  can openpyxl read font colors mperemsky 3 1,655 May-09-2023, 11:18 AM
Last Post: MindKeeper
  ANSI not working for change of text colors BliepMonster 10 3,247 Nov-10-2022, 09:28 AM
Last Post: BliepMonster
  How to do bar graph with positive and negative values different colors? Mark17 1 5,002 Jun-10-2022, 07:38 PM
Last Post: Mark17
  Plot Back Ground Colors JoeDainton123 0 2,167 Aug-19-2020, 11:09 PM
Last Post: JoeDainton123
  How do I map a list of values to specified colors? larkypython 4 2,505 Nov-05-2019, 09:22 AM
Last Post: larkypython
  after using openpyxl to add colors to script, black shows up white online in excel Soundtechscott 1 3,651 Jun-08-2019, 10:33 PM
Last Post: Soundtechscott
  How to plot two list on the same graph with different colors? Alberto 2 28,695 Jul-18-2017, 09:20 AM
Last Post: Alberto
  How to print in colors JohnNo 2 3,142 Apr-01-2017, 02:14 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020