diff --git a/Book3_Ch02_Python_Codes/Bk3_Ch2_10.py b/Book3_Ch02_Python_Codes/Bk3_Ch2_10.py index e9f08e9..5ab0f24 100644 --- a/Book3_Ch02_Python_Codes/Bk3_Ch2_10.py +++ b/Book3_Ch02_Python_Codes/Bk3_Ch2_10.py @@ -120,4 +120,6 @@ yticklabels=np.arange(1,m+1), xticklabels=np.arange(1,n+1)) ax.set_aspect("equal") plt.title('$C$') -plt.yticks(rotation=0) \ No newline at end of file +plt.yticks(rotation=0) + +plt.show() diff --git a/Book3_Ch16_Python_Codes/Bk3_Ch16_01.py b/Book3_Ch16_Python_Codes/Bk3_Ch16_01.py index f187c18..991fae6 100644 --- a/Book3_Ch16_Python_Codes/Bk3_Ch16_01.py +++ b/Book3_Ch16_Python_Codes/Bk3_Ch16_01.py @@ -142,7 +142,7 @@ def plot_surface(xx, yy, surface, title_txt): colorbar = ax.contour(xx,yy, surface,20, cmap = 'RdYlBu_r') - # fig.colorbar(colorbar, ax=ax) + fig.colorbar(colorbar, ax=ax) ax.set_proj_type('ortho') @@ -155,19 +155,19 @@ def plot_surface(xx, yy, surface, title_txt): ax.view_init(azim=-135, elev=30) ax.grid(False) - plt.show() + # plt.show() - ax = fig.add_subplot(1, 2, 2) + ax2 = fig.add_subplot(1, 2, 2) - colorbar = ax.contourf(xx,yy, surface, 20, cmap='RdYlBu_r') + colorbar = ax2.contourf(xx,yy, surface, 20, cmap='RdYlBu_r') - # fig.colorbar(colorbar, ax=ax) + fig.colorbar(colorbar, ax=ax2) - ax.set_xlim(xx.min(), xx.max()) - ax.set_ylim(yy.min(), yy.max()) + ax2.set_xlim(xx.min(), xx.max()) + ax2.set_ylim(yy.min(), yy.max()) - ax.set_xlabel('$x_1$') - ax.set_ylabel('$x_2$') + ax2.set_xlabel('$x_1$') + ax2.set_ylabel('$x_2$') plt.gca().set_aspect('equal', adjustable='box') plt.show()