Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Book3_Ch02_Python_Codes/Bk3_Ch2_10.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
plt.yticks(rotation=0)

plt.show()
18 changes: 9 additions & 9 deletions Book3_Ch16_Python_Codes/Bk3_Ch16_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand All @@ -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()
Expand Down