Skip to content

Commit c8372e5

Browse files
committed
Install matplotlib types for pre-commit-mypy
1 parent 37e4255 commit c8372e5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ repos:
4747
- types-requests
4848
- pandas-stubs
4949
- types-pillow
50+
- matplotlib
5051
exclude: |
5152
(?x)(
5253
^build/

advanced/mathematical_optimization/examples/plot_exercise_flat_minimum.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ def g_prime(x):
4949
plt.figure(1)
5050
plt.clf()
5151
X, Y = np.mgrid[-1.5:1.5:100j, -1.1:1.1:100j] # type: ignore[misc]
52-
plt.imshow(
53-
f([X, Y]).T, cmap="gray_r", extent=(-1.5, 1.5, -1.1, 1.1), origin="lower"
54-
)
52+
plt.imshow(f([X, Y]).T, cmap="gray_r", extent=(-1.5, 1.5, -1.1, 1.1), origin="lower")
5553
plt.contour(X, Y, f([X, Y]), cmap="gnuplot")
5654

5755
# Plot the gradient

0 commit comments

Comments
 (0)