I am trying to draw to parallel diagonal lines in python and fill in between the two lines. when I create the fill it creates a horizontal line at the bottom which I don not want. How can I remove that line.
I am using matplolib fill_inbetween function.
<code>import matplotlib.pyplot as plt
import numpy as np
plt.figure(figsize=(8, 6))
plt.fill_between([5 / 2, 5 / 2 + 1, 5 / 2 + 1.5, 5 / 2 + 0.5],
[0, 5, 5, 0],
color='yellow', alpha=0.3)
plt.show()
</code>
<code>import matplotlib.pyplot as plt
import numpy as np
plt.figure(figsize=(8, 6))
plt.fill_between([5 / 2, 5 / 2 + 1, 5 / 2 + 1.5, 5 / 2 + 0.5],
[0, 5, 5, 0],
color='yellow', alpha=0.3)
plt.show()
</code>
import matplotlib.pyplot as plt
import numpy as np
plt.figure(figsize=(8, 6))
plt.fill_between([5 / 2, 5 / 2 + 1, 5 / 2 + 1.5, 5 / 2 + 0.5],
[0, 5, 5, 0],
color='yellow', alpha=0.3)
plt.show()
the code produces the following image.
image
New contributor
Mohamed Mallasi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.