From 52693be83e442fb17e956720f88285113d1e1896 Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Wed, 11 Sep 2024 11:56:58 +0200 Subject: [PATCH] tests/11-vacuum: use exp notation on colorbar --- tests/11-vacuum/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/11-vacuum/__init__.py b/tests/11-vacuum/__init__.py index a323b4d..3d79d94 100644 --- a/tests/11-vacuum/__init__.py +++ b/tests/11-vacuum/__init__.py @@ -140,7 +140,8 @@ class Test(GrayTest, TestCase): plt.tricontourf(data['x'], data['y'], abs(S_true.real - S_gray.real), levels=8, cmap='summer') - plt.colorbar() + cbar = plt.colorbar() + cbar.ax.ticklabel_format(scilimits=[0, 0], useMathText=True) plt.scatter(data['x'], data['y'], c='k', s=5) plt.subplot(122, aspect='equal') @@ -151,7 +152,8 @@ class Test(GrayTest, TestCase): plt.tricontourf(data['x'], data['y'], abs(S_true.imag - S_gray.imag), levels=8, cmap='summer') - plt.colorbar() + cbar = plt.colorbar() + cbar.ax.ticklabel_format(scilimits=[0, 0], useMathText=True) plt.scatter(data['x'], data['y'], c='k', s=5) plt.show()