diff --git a/plot_types/arrays/contourf.py b/plot_types/arrays/contourf.py index 66f2b90c8739..02c8f2a124d2 100644 --- a/plot_types/arrays/contourf.py +++ b/plot_types/arrays/contourf.py @@ -13,8 +13,7 @@ # make data X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256)) Z = (1 - X/2. + X**5 + Y**3) * np.exp(-X**2 - Y**2) -Z = Z - Z.min() -levels = np.linspace(np.min(Z), np.max(Z), 7) +levels = np.linspace(Z.min(), Z.max(), 7) # plot fig, ax = plt.subplots() diff --git a/plot_types/arrays/imshow.py b/plot_types/arrays/imshow.py index 36a6915606af..53b50f667a37 100644 --- a/plot_types/arrays/imshow.py +++ b/plot_types/arrays/imshow.py @@ -14,7 +14,6 @@ # make data X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256)) Z = (1 - X/2. + X**5 + Y**3) * np.exp(-X**2 - Y**2) -Z = Z - Z.min() Z = Z[::16, ::16] # plot diff --git a/plot_types/arrays/pcolormesh.py b/plot_types/arrays/pcolormesh.py index 86d34ffbe6cd..30d166ff0d71 100644 --- a/plot_types/arrays/pcolormesh.py +++ b/plot_types/arrays/pcolormesh.py @@ -15,7 +15,6 @@ # make full-res data X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256)) Z = (1 - X/2. + X**5 + Y**3) * np.exp(-X**2 - Y**2) -Z = Z - Z.min() # sample unevenly in x: dx = np.sqrt((np.arange(16) - 8)**2) + 6 @@ -29,6 +28,6 @@ fig, ax = plt.subplots() ax.grid(False) -ax.pcolormesh(X, Y, Z, vmin=0, vmax=1.5) +ax.pcolormesh(X, Y, Z, vmin=-0.5, vmax=1.0) plt.show() diff --git a/plot_types/unstructured/tricontour.py b/plot_types/unstructured/tricontour.py index 4fb003c34a42..1b76a6b976f1 100644 --- a/plot_types/unstructured/tricontour.py +++ b/plot_types/unstructured/tricontour.py @@ -13,7 +13,6 @@ # make structured data X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256)) Z = (1 - X/2. + X**5 + Y**3) * np.exp(-X**2 - Y**2) -Z = Z - Z.min() # sample it to make unstructured x, y, z np.random.seed(1) @@ -27,7 +26,7 @@ fig, ax = plt.subplots() ax.plot(x, y, '.k', alpha=0.5) -levels = np.linspace(np.min(Z), np.max(Z), 7) +levels = np.linspace(Z.min(), Z.max(), 7) ax.tricontourf(x, y, z, levels=levels) ax.set(xlim=(-3, 3), ylim=(-3, 3)) diff --git a/plot_types/unstructured/tripcolor.py b/plot_types/unstructured/tripcolor.py index 3c0cadfe440f..891dd36afe9c 100644 --- a/plot_types/unstructured/tripcolor.py +++ b/plot_types/unstructured/tripcolor.py @@ -12,8 +12,7 @@ # make structured data X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256)) -Z = (1 - X/2. + X**5 + Y**3)*np.exp(-X**2-Y**2) -Z = Z - Z.min() +Z = (1 - X/2. + X**5 + Y**3) * np.exp(-X**2 - Y**2) # sample it to make unstructured x, y, z np.random.seed(1)