Skip to content

Commit 5e21d05

Browse files
authored
Merge pull request matplotlib#17154 from QuLogic/doc-fixes
DOC: Fix some warning and unreproducibility
2 parents 8e2f715 + 0c0dabc commit 5e21d05

File tree

26 files changed

+94
-10
lines changed

26 files changed

+94
-10
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ mpl-run: &mpl-install
6363
doc-run: &doc-build
6464
name: Build documentation
6565
command: |
66+
# Set epoch to date of latest tag.
67+
export SOURCE_DATE_EPOCH="$(git log -1 --format=%at $(git describe --abbrev=0))"
6668
make html O=-T
6769
rm -r build/html/_sources
6870
working_directory: doc

examples/axes_grid1/demo_anchored_direction_arrows.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredDirectionArrows
1010
import matplotlib.font_manager as fm
1111

12+
13+
# Fixing random state for reproducibility
14+
np.random.seed(19680801)
15+
1216
fig, ax = plt.subplots()
1317
ax.imshow(np.random.random((10, 10)))
1418

examples/event_handling/image_slices_viewer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
import matplotlib.pyplot as plt
1111

1212

13+
# Fixing random state for reproducibility
14+
np.random.seed(19680801)
15+
16+
1317
class IndexTracker:
1418
def __init__(self, ax, X):
1519
self.ax = ax

examples/event_handling/pick_event_demo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ def pick_handler(event):
7070
from numpy.random import rand
7171

7272

73+
# Fixing random state for reproducibility
74+
np.random.seed(19680801)
75+
76+
7377
def pick_simple():
7478
# simple picking, lines, rectangles and text
7579
fig, (ax1, ax2) = plt.subplots(2, 1)

examples/event_handling/pick_event_demo2.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
import matplotlib.pyplot as plt
1212

1313

14+
# Fixing random state for reproducibility
15+
np.random.seed(19680801)
16+
1417
X = np.random.rand(100, 1000)
1518
xs = np.mean(X, axis=1)
1619
ys = np.std(X, axis=1)

examples/event_handling/zoom_window.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
import matplotlib.pyplot as plt
1818
import numpy as np
1919

20+
21+
# Fixing random state for reproducibility
22+
np.random.seed(19680801)
23+
2024
figsrc, axsrc = plt.subplots()
2125
figzoom, axzoom = plt.subplots()
2226
axsrc.set(xlim=(0, 1), ylim=(0, 1), autoscale_on=False,

examples/images_contours_and_fields/image_demo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
from matplotlib.path import Path
1818
from matplotlib.patches import PathPatch
1919

20+
21+
# Fixing random state for reproducibility
22+
np.random.seed(19680801)
23+
2024
###############################################################################
2125
# First we'll generate a simple bivariate normal distribution.
2226

examples/images_contours_and_fields/pcolor_demo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
import numpy as np
1313
from matplotlib.colors import LogNorm
1414

15+
16+
# Fixing random state for reproducibility
17+
np.random.seed(19680801)
18+
1519
###############################################################################
1620
# A simple pcolor demo
1721
# --------------------

examples/images_contours_and_fields/spy_demos.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
import matplotlib.pyplot as plt
1010
import numpy as np
1111

12+
13+
# Fixing random state for reproducibility
14+
np.random.seed(19680801)
15+
1216
fig, axs = plt.subplots(2, 2)
1317
ax1 = axs[0, 0]
1418
ax2 = axs[0, 1]

examples/lines_bars_and_markers/scatter_custom_symbol.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
import matplotlib.pyplot as plt
1010
import numpy as np
1111

12+
13+
# Fixing random state for reproducibility
14+
np.random.seed(19680801)
15+
1216
# unit area ellipse
1317
rx, ry = 3., 1.
1418
area = rx * ry * np.pi

0 commit comments

Comments
 (0)