Skip to content

Commit 273f525

Browse files
authored
Remove unwanted outputs from doc (#608)
1 parent 052d699 commit 273f525

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

docs/examples/autodiff/plot_soft_dtw_loss_for_pytorch_nn.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ def fit(self, X, y, max_epochs=10):
115115
ts_index = 50
116116
y_pred = model(X_test[:, :150, 0]).detach().numpy()
117117

118-
plt.figure()
118+
plt.figure(1, layout="constrained")
119119
plt.title('Multi-step ahead forecasting using MSE')
120120
plt.plot(X_test[ts_index].ravel())
121121
plt.plot(np.arange(150, 275), y_pred[ts_index], 'r-')
122-
122+
plt.show()
123123

124124
##############################################################################
125125
# Using Soft-DTW as a loss function
@@ -143,7 +143,8 @@ def fit(self, X, y, max_epochs=10):
143143

144144
y_pred = model(X_test[:, :150, 0]).detach().numpy()
145145

146-
plt.figure()
146+
plt.figure(2, layout="constrained")
147147
plt.title('Multi-step ahead forecasting using Soft-DTW loss')
148148
plt.plot(X_test[ts_index].ravel())
149149
plt.plot(np.arange(150, 275), y_pred[ts_index], 'r-')
150+
plt.show()

docs/examples/metrics/plot_dtw.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
path, sim = metrics.dtw_path(s_y1, s_y2)
6969

70-
plt.figure(1, figsize=(8, 8))
70+
plt.figure(layout="constrained", figsize=(8, 8))
7171

7272
# definitions for the axes
7373
left, bottom = 0.01, 0.1
@@ -100,5 +100,4 @@
100100
ax_s_y.axis("off")
101101
ax_s_y.set_ylim((0, sz - 1))
102102

103-
plt.tight_layout()
104103
plt.show()

docs/examples/metrics/plot_dtw_custom_metric.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def arc_length(angle_1, angle_2, r=1.):
103103
rect_s_x = [left_h, bottom_h, width, h_ts]
104104

105105
# Plot example 1
106-
plt.figure(1, figsize=(6, 6))
106+
plt.figure(1, layout="constrained", figsize=(6, 6))
107107
ax_dist = plt.axes(rect_dist)
108108
ax_s_x = plt.axes(rect_s_x)
109109
ax_s_y = plt.axes(rect_s_y)
@@ -133,7 +133,7 @@ def arc_length(angle_1, angle_2, r=1.):
133133
horizontalalignment="center", verticalalignment="top")
134134

135135
# Plot example 2
136-
plt.figure(2, figsize=(6, 6))
136+
plt.figure(2, layout="constrained", figsize=(6, 6))
137137
ax_dist = plt.axes(rect_dist)
138138
ax_s_x = plt.axes(rect_s_x)
139139
ax_s_y = plt.axes(rect_s_y)
@@ -153,5 +153,4 @@ def arc_length(angle_1, angle_2, r=1.):
153153
ax_s_y.imshow(np.flip(dataset_2[0], axis=1), aspect="auto", cmap=cm)
154154
ax_s_y.axis("off")
155155

156-
plt.tight_layout()
157156
plt.show()

docs/examples/metrics/plot_lcss.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,4 @@
6262
plt.legend()
6363
plt.title("Time series matching with DTW")
6464

65-
plt.tight_layout()
6665
plt.show()

docs/examples/metrics/plot_lcss_custom_metric.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def arc_length(angle_1, angle_2, r=1.):
8686
rect_s_x = [left_h, bottom_h, width, h_ts]
8787

8888
# Plot example
89-
plt.figure(1, figsize=(6, 6))
89+
plt.figure(layout="constrained", figsize=(6, 6))
9090
ax_dist = plt.axes(rect_dist)
9191
ax_s_x = plt.axes(rect_s_x)
9292
ax_s_y = plt.axes(rect_s_y)
@@ -115,5 +115,4 @@ def arc_length(angle_1, angle_2, r=1.):
115115
ax_s_y.text(-loc, 0, s, fontsize="large", color="grey",
116116
horizontalalignment="center", verticalalignment="top")
117117

118-
plt.tight_layout()
119118
plt.show()

0 commit comments

Comments
 (0)