ax[i].set_xlabel(r"distance from soma ($\mu$m)") else: ax[i].set_ylabel(r"Ca ($\mu$M)") ax[i].set_xlabel('Time (ms)') ax[i].legend(loc=1, frameon=False, handlelength=3) fname = 'Fig_1' for i, x in enumerate(ax): if i != 1 and i != 0: x.set_ylim([0, m * 1.1]) x.yaxis.set_ticks([0., 0.2, 0.4]) elif i == 0: x.yaxis.set_ticks([0., 0.03, 0.06]) else: x.yaxis.set_ticks([0., 0.1, 0.2]) ff.add_title(x, titles[i]) ff.simpleaxis(x) fig.subplots_adjust(hspace=.55) #fig.subplots_adjust(wspace=.6) plt.savefig('Fig_1.png', format='png', bbox_inches='tight', pad_inches=0.1) plt.savefig('Fig_1.svg', format='svg', bbox_inches='tight', pad_inches=0.1) plt.savefig('Fig_1.pdf', format='pdf', bbox_inches='tight', pad_inches=0.1) plt.show()
ax.append(fig.add_subplot(4, 2, 7)) ax.append(fig.add_subplot(4, 2, 8)) for i, fname in enumerate(flist): f = open(fname) print fname header = f.readline().split() data = np.loadtxt(f) spines = cw.parse_header(header) sp = 'spine_1' dt = data[1, 0] - data[0, 0] beg_1 = int(beg / dt) end_1 = int(end / dt) ax[i].plot(data[:, 0], 1000 * data[:, spines[sp][col]], 'k') #color=colors[i/2]) ff.simpleaxis(ax[i]) #img = im.imread(imlist[i]) #ax_im = inset_axes(ax[i],width="50%",height=.5,loc=2) #ax_im.imshow(img) #ax_im.axes.get_xaxis().set_visible(False) #ax_im.axes.get_yaxis().set_visible(False) #ax_im.set_frame_on(False) new_time = np.arange(-100, 250 - dt * 1000, dt * 1000) ax[i].set_xlim([0, lim]) if (i % 2): ax[7].plot(new_time, 1000 * data[beg_1:end_1, spines[sp][col]], color=colors[i / 2], label=labels[i / 2])