a.set_xticklabels([]) a.set_yticklabels([]) a.set_xticks([]) a.set_yticks([]) """ from matplotlib.matlab import figure, close, axes, subplot, show from matplotlib.numerix import arange, sin, pi t = arange(0.0, 1.0, 0.01) fig = figure(1) ax1 = subplot(211) ax1.plot(t, sin(2*pi*t)) ax1.grid(True) ax1.set_ylim( (-2,2) ) ax1.set_ylabel('1 Hz') ax1.set_title('A sine wave or two') for label in ax1.get_xticklabels(): label.set_color('r') ax2 = subplot(212) ax2.plot(t, sin(2*2*pi*t)) ax2.grid(True) ax2.set_ylim( (-2,2) ) l = ax2.set_xlabel('Hi mom')
color=darkblue, linewidth=3) ax[i].plot(x, [t_ref[k][i] for k in K], color=lightblue, linewidth=3) ax[i].set_xticks([]) ax[i].set_title('Limited memory p = %-d' % plist[i], fontsize='small') ax[i].legend(['Python', 'Fortran'], 'upper left') for i in [2, 3]: ax[i].set_ylabel('Time (s)', fontsize='small') MM.show() # For the number of iterations, use first value of p as reference x = range(len(i_lst.keys())) ax = MM.subplot(111) lgnd = [] for i in range(len(plist)): lgnd.append('p = %-d' % plist[i]) ax.plot(x, [(1.0 * i_lst[k][0]) / i_lst[k][0] for k in K], 'k-') ax.plot(x, [(1.0 * i_lst[k][1]) / i_lst[k][0] for k in K], 'k:') ax.plot(x, [(1.0 * i_lst[k][2]) / i_lst[k][0] for k in K], 'k-.') ax.plot(x, [(1.0 * i_lst[k][3]) / i_lst[k][0] for k in K], 'k--') ax.legend(lgnd, 'upper right') ax.set_title('Number of iterations(p)/Number of iterations(0)') ax.set_xticklabels(K, rotation=45, horizontalalignment='right', fontsize='small') MM.show()
a.set_xticklabels([]) a.set_yticklabels([]) a.set_xticks([]) a.set_yticks([]) """ from matplotlib.matlab import figure, close, axes, subplot, show from matplotlib.numerix import arange, sin, pi t = arange(0.0, 1.0, 0.01) fig = figure(1) ax1 = subplot(211) ax1.plot(t, sin(2 * pi * t)) ax1.grid(True) ax1.set_ylim((-2, 2)) ax1.set_ylabel("1 Hz") ax1.set_title("A sine wave or two") for label in ax1.get_xticklabels(): label.set_color("r") ax2 = subplot(212) ax2.plot(t, sin(2 * 2 * pi * t)) ax2.grid(True) ax2.set_ylim((-2, 2)) l = ax2.set_xlabel("Hi mom")
ax = [] ax.append(MM.axes([ .05, .05, .40, .40 ])) # lower left ax.append(MM.axes([ .05, .55, .40, .40 ])) # upper left ax.append(MM.axes([ .55, .05, .40, .40 ])) # lower right ax.append(MM.axes([ .55, .55, .40, .40 ])) # upper right for i in range(4): ax[i].plot(x, [ t_lst[k][i] for k in K ], color=darkblue, linewidth=3) ax[i].plot(x, [ t_ref[k][i] for k in K ], color=lightblue, linewidth=3) ax[i].set_xticks([]) ax[i].set_title('Limited memory p = %-d' % plist[i], fontsize='small') ax[i].legend(['Python', 'Fortran'], 'upper left') for i in [2,3]: ax[i].set_ylabel('Time (s)', fontsize='small') MM.show() # For the number of iterations, use first value of p as reference x = range(len(i_lst.keys())) ax = MM.subplot(111) lgnd = [] for i in range(len(plist)): lgnd.append('p = %-d' % plist[i]) ax.plot(x, [ (1.0*i_lst[k][0])/i_lst[k][0] for k in K ], 'k-') ax.plot(x, [ (1.0*i_lst[k][1])/i_lst[k][0] for k in K ], 'k:') ax.plot(x, [ (1.0*i_lst[k][2])/i_lst[k][0] for k in K ], 'k-.') ax.plot(x, [ (1.0*i_lst[k][3])/i_lst[k][0] for k in K ], 'k--') ax.legend(lgnd, 'upper right') ax.set_title('Number of iterations(p)/Number of iterations(0)') ax.set_xticklabels(K, rotation = 45, horizontalalignment = 'right', fontsize='small') MM.show()