def plot_mds(subjects, experiments, axes):
for subj, exp, ax in zip(subjects, experiments, axes):
res_fname = "correlation_analysis/{}_{}_ifs.pkz".format(subj, exp)
res = moss.load_pkl(res_fname)
sorter = np.argsort(np.abs(res.prefs))
x_, y_ = res.mds_coords.T.dot(res.prefs)
t = np.arctan2(y_, x_)
rot = [[np.cos(t), np.sin(t)], [-np.sin(t), np.cos(t)]]
x, y = np.dot(rot, res.mds_coords[sorter].T)
cmap = get_colormap(exp)
ax.scatter(x, y, c=res.prefs[sorter],
cmap=cmap, vmin=-1.75, vmax=1.75,
s=8, linewidth=0)
ax.set(xlim=(-.9, .9), ylim=(-.9, .9), aspect="equal")
ax.set_axis_off()
评论列表
文章目录