FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add 3D scatter test for cmap update by MiniX16 · Pull Request #30062 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
22 changes: 22 additions & 0 deletions lib/matplotlib/tests/test_collections.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,28 @@ def test_polycollection_close():
ax.set_ylim3d(0, 4)


@check_figures_equal(extensions=["png"])
def test_scalarmap_change_cmap(fig_test, fig_ref):
# Ensure that changing the colormap of a 3D scatter after draw updates the colors.

x, y, z = np.array(list(itertools.product(
np.arange(0, 5, 1),
np.arange(0, 5, 1),
np.arange(0, 5, 1)
))).T
c = x + y

# test
ax_test = fig_test.add_subplot(111, projection='3d')
sc_test = ax_test.scatter(x, y, z, c=c, s=40, cmap='jet')
fig_test.canvas.draw()
sc_test.set_cmap('viridis')

# ref
ax_ref = fig_ref.add_subplot(111, projection='3d')
ax_ref.scatter(x, y, z, c=c, s=40, cmap='viridis')


@image_comparison(['regularpolycollection_rotate.png'], remove_text=True)
def test_regularpolycollection_rotate():
xx, yy = np.mgrid[:10, :10]
Expand Down

Back | FazBrowse Home | New Git URL