8000 parent 29a3707a48bfe2abdf7bd58cfa449015742b5aa4 · matplotlib/matplotlib@a516cbd · GitHub
[go: up one dir, main page]

Skip to content

Commit a516cbd

Browse files
author
Lucas Ricci
committed
parent 29a3707
author Lucas Ricci <llricci@aluno.crb.g12.br> 1636671767 -0300 committer Lucas Ricci <llricci@aluno.crb.g12.br> 1636755318 -0300 parent 29a3707 author Lucas Ricci <llricci@aluno.crb.g12.br> 1636671767 -0300 committer Lucas Ricci <llricci@aluno.crb.g12.br> 1636755293 -0300 deleted and updated baseline image for test_hexbin_linear() Resolve issue #21165, Add Hexbin Linear test a little correction in the code update Update update update a few corrections Resolve issue #21165, Add Hexbin Linear test a little correction in the code Resolve issue #21165, Add Hexbin Linear test a little correction in the code update Update update update a few corrections removing a typo where hexbon_linear() were duplicated
1 parent 29a3707 commit a516cbd

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Loading

lib/matplotlib/tests/test_axes.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,55 @@ def test_hexbin_log():
786786 8000
plt.colorbar(h)
787787

788788

789+
<<<<<<< HEAD
790+
@image_comparison(baseline_images=['hexbin_linear'],
791+
extensions=['png'], style='mpl20')
792+
def test_hexbin_linear():
793+
794+
np.random.seed(19680801)
795+
n = 100000
796+
x = np.random.standard_normal(n)
797+
y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n)
798+
799+
fig, ax = plt.subplots()
800+
h = ax.hexbin(x, y, marginals=True, reduce_C_function=np.sum)
801+
plt.colorbar(h)
802+
803+
804+
@image_comparison(['hexbin_linear.png'], style='mpl20')
805+
def test_hexbin_linear():
806+
# Issue #21165 (add a hexbin_linear test)
807+
808+
plt.rcParams['pcolormesh.snap'] = False
809+
810+
np.random.seed(19680801)
811+
n = 100000
812+
x = np.random.standard_normal(n)
813+
y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n)
814+
y = np.power(2, y * 0.5)
815+
816+
fig, ax = plt.subplots()
817+
h = ax.hexbin(x, y, yscale='log', bins='log',
818+
marginals=True, reduce_C_function=np.sum)
819+
plt.colorbar(h)
820+
821+
822+
=======
823+
>>>>>>> f2fa2e58e5... removing a typo where hexbon_linear() were duplicated
824+
@image_comparison(baseline_images=['hexbin_linear'],
825+
extensions=['png'], style='mpl20')
826+
def test_hexbin_linear():
827+
828+
np.random.seed(19680801)
829+
n = 100000
830+
x = np.random.standard_normal(n)
831+
y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n)
832+
833+
fig, ax = plt.subplots()
834+
h = ax.hexbin(x, y, marginals=True, reduce_C_function=np.sum)
835+
plt.colorbar(h)
836+
837+
789838
def test_hexbin_log_clim():
790839
x, y = np.arange(200).reshape((2, 100))
791840
fig, ax = plt.subplots()

0 commit comments

Comments
 (0)
0