Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incorrect fill_betweenx interpolation #9235

Closed
@dopplershift

Description

@dopplershift

This sample:

import matplotlib.pyplot as plt
import numpy as np

p = np.array([724.3, 700, 655])
t = np.array([9.4, 7, 2.2])
prof = np.array([7.9, 6.6, 3.8])

fig = plt.figure(figsize=(9, 9))
ax = fig.add_subplot(1, 1, 1)

ax.plot(t, p, 'tab:red')
ax.plot(prof, p, 'k')

ax.fill_betweenx(p, t, prof, where=prof<t,
                            facecolor='blue', interpolate=True, alpha=0.4)
ax.fill_betweenx(p, t, prof, where=prof>t,
                            facecolor='red', interpolate=True, alpha=0.4)

ax.set_xlim(0, 30)
ax.set_ylim(800, 600)

is producing incorrect results on 2.1rc:

fill_between

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions