Skip to content

Commit 64d5a10

Browse files
committed
I2MC.plot now works with data for only a single eye
1 parent b41a1cd commit 64d5a10

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/I2MC/plot/plot.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ def data_and_fixations(data, fix, fix_as_line=True, unit='pixels', res=None):
7878
ax1.set_ylim([0, res[1]])
7979

8080
### Plot X position
81-
for p in range(Xdat.shape[0]):
82-
ax1.plot(np.array(time),Xdat[p,:],klr[p]+'-', linewidth = traceLW)
81+
Xdatp = np.atleast_2d(Xdat)
82+
for p in range(Xdatp.shape[0]):
83+
ax1.plot(np.array(time),Xdatp[p,:],klr[p]+'-', linewidth = traceLW)
8384

8485
### Plot Y posiiton
85-
for p in range(Ydat.shape[0]):
86-
ax2.plot(np.array(time),Ydat[p,:],klr[p]+'-', linewidth = traceLW)
86+
Ydatp = np.atleast_2d(Ydat)
87+
for p in range(Ydatp.shape[0]):
88+
ax2.plot(np.array(time),Ydatp[p,:],klr[p]+'-', linewidth = traceLW)
8789

8890
# add fixations
8991
if fix_as_line:

0 commit comments

Comments
 (0)