8000 plot with solid line overhangs fill_between · Issue #8974 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
plot with solid line overhangs fill_between #8974
Closed
@LindyBalboa

Description

@LindyBalboa

When overlaying plot upon a fill_between, the line hangs over the ends. This is most notable with the solid linestyle, but affects all of them. Minor detail but seriously decreases the quality factor of a plot.

import matplotlib as mpl
from matplotlib import pyplot as plt
import numpy as np 

mpl.rc('lines', linewidth=10) #optional to improve visibility
plt.cla()
x=np.linspace(0,1,1000)
y=x
plt.plot(x,y,zorder=2, color='k')
plt.fill_between(x,y+.05,y-.05, color='r', zorder=1)

y=x+0.5
plt.plot(x, y, color='k', zorder=2, linestyle="--")
plt.fill_between(x,y+.05,y-.05, color='r', zorder=1)

y=x+1
plt.plot(x, y, color='k', zorder=2, linestyle=":")
plt.fill_between(x, y+.05, y-.05, color='r', zorder=1)

y=x+1.5
plt.plot(x, y, color='k', zorder=2, linestyle="-.")
plt.fill_between(x, y+.05, y-.05, color='r', zorder=1)

plt.show()
# Paste your code here
#
#

Outcome
untitled

Expected outcome
untitled1

Matplotlib version

  • Operating System: cygwin64 fresh install
  • Matplotlib Version: 2.0.2
  • Python Version: 3.6.1
  • Jupyter Version (if applicable): 5.0.0
  • Other Libraries:

installed from pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0