def tconvert_img(xtestzahl, imgname): #3161-4027 #Visualizieren die letzte 60 Tag plt.figure(figsize=(2, 2)) axes = plt.gca() #axes.set_xlim([xmin,xmax]) axes.set_ylim([0, 0.5]) plt.plot(prex_train[xtestzahl]) plt.savefig('xtest_img/' + imgname)
def save_scattered_image(z, id, name='scattered_image.jpg'): N = 17 plotn = 2 plt.figure(figsize=(8, 6)) plt.scatter(z[:, 0], z[:, 1], c=id, marker='o', edgecolor='none', cmap=discrete_cmap(N, 'jet')) plt.colorbar(ticks=range(N)) axes = plt.gca() axes.set_xlim([-4.5 * plotn, 4.5 * plotn]) axes.set_ylim([-4.5 * plotn, 4.5 * plotn]) plt.grid(True) plt.savefig(name)
xline.append(delta*j) yline.append(delta*i) X.append(xline) Y.append(yline) U = Ex V = Ey fig, ax = plt.subplots() widths = np.linspace(0, 1, V.size) w = 0.003 plt.quiver(X, Y, V, U, width = w) plt.title(u'Картина поля за допомогою векторів напруженості електричного поля') axes = plt.gca() axes.set_xlim([-0.1,6.1]) axes.set_ylim([-0.1,3.1]) fig.savefig('~/Desktop/ТП/1.png') plt.close(fig) fig, ax = plt.subplots() CS = ax.contour(X, Y, a, levels = np.arange(-1, 3, 0.2)) ax.clabel(CS, inline=True, fontsize=10) ax.set_title(u'Картина поля за допомогою еквіпотенціалей') ax.set_xlim([-0.1,6.1]) ax.set_ylim([-0.1,3.1]) plt.show() fig = plt.figure() ax = fig.gca(projection='3d') CS = ax.plot_surface(X, Y, a, cmap = cm.coolwarm) ax.contour(X, Y, a, zdir='z', offset=-0.7, levels = np.arange(-1, 3, 0.2))
#axes.set_title('Geant2012',color='Black',size=20) # axes[1].set_title('k=32',color='#77933C') # axes[2].set_title('k=Geant2012',color='#77933C') axes.set_yscale('log') #axes[0].set_yscale('log') #axes[1].get_yaxis().set_ticks([]) #axes[2].set_yscale('log') axes.set_ylabel('Time (ms)',size = 50, color='Black') axes.set_xlabel('Functions\' Chain Size',size = 50, color='Black') axes.yaxis.grid(b=True, which='major', color='dimgray', linestyle='--',linewidth = 5.0) axes.set_ylim([1,80000]) axes.set_xlim([0,16]) axes.set_xticks([1.5, 4.5, 7.5,10.5,13.5]) axes.set_xticklabels(['3', '4', '5','6','7'],color='black',size=35) axes.tick_params(axis='y', colors='black',size=35) for tic in axes.yaxis.get_major_ticks(): tic.label.set_fontsize(35) #for tic in axes[2].yaxis.get_major_ticks(): # tic.label1On = tic.label2On = False # set axes limits and labels hB, = axes.plot([0,0],'g-',linewidth = 3.0) hR, = axes.plot([0,0],'-',color='#C00000', linewidth = 3.0)