Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fill_between incorrect with log y-axis and value 0 #8623

Closed
@cdeil

Description

@cdeil

fill_between doesn't give the result I expect if using a log y-axis and having a value of 0 in the y1 array.

Example:

%matplotlibinlineimportnumpyasnpimportmatplotlib.pyplotaspltx=np.array([1,2,3,4,5])y1=np.array([9,2,8,3,0])y2=np.array([10,10,10,10,10])plt.plot(x,y1,lw=3,color='green')plt.plot(x,y2,lw=3,color='red')plt.fill_between(x,y1,y2)plt.loglog()

Actual outcome:

The polygon created by fill_between somehow connects the last and first point, resulting in a completely incorrect patch:

image

Expected outcome

I was expecting / hoping that the band would be filled correctly and simply clipped (i.e. the result I get when changing the last y1 value from 0 to e.g. 1e-10). In the plot, the blue fill should be between the red and green line.

Matplotlib version

This is with Matplotlib 2.0.0.
(on Macports, but I don't think that matters)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp