Skip to content

Commit ee89c43

Browse files
committed
DOC fix plot with simulated delays
1 parent 4385f07 commit ee89c43

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tutorials/movies_3T/03_plot_hemodynamic_response.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,16 @@
182182
# function.
183183

184184
import matplotlib.pyplot as plt
185-
axs = plt.subplots(6, 1, figsize=(8, 6.5), constrained_layout=True, sharex=True)
185+
fig, axs = plt.subplots(6, 1, figsize=(8, 6.5), constrained_layout=True,
186+
sharex=True)
186187
times = np.arange(n_trs)*TR
187188

188189
axs[0].plot(times, y, color="r")
189190
axs[0].set_title("BOLD response")
190191
for i, (ax, xx) in enumerate(zip(axs.flat[1:], x_delayed.T)):
191192
ax.plot(times, xx, color='k')
192-
ax.set_title("$x(t - {0})$ (feature delayed by {0})".format(i))
193+
ax.set_title("$x(t - {0:.0f})$ (feature delayed by {1} sample{2})".format(
194+
i*TR, i, "" if i == 1 else "s"))
193195
for ax in axs.flat:
194196
ax.axvline(40, color='gray')
195197
ax.set_yticks([])

0 commit comments

Comments
 (0)