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

Skip to content

Fix fill_between with decreasing data #9236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test for #9235
  • Loading branch information
dopplershift committed Sep 26, 2017
commit 61f4fa319ea60e8c460fd502eca3cbc1bfb09cb4
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,28 @@ def test_fill_between_interpolate():
interpolate=True)


@image_comparison(baseline_images=['fill_between_interpolate_decreasing'],
style='mpl20', remove_text=True)
def test_fill_between_interpolate_decreasing():
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)


@image_comparison(baseline_images=['symlog'])
def test_symlog():
x = np.array([0, 1, 2, 4, 6, 9, 12, 24])
Expand Down