习题2.5代码
import numpy as np
import pandas as pd
import sympy as sp
sp.init_printing(use_unicode=True)
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['Times New Roman + SimSun + WFM Sans SC']
plt.rcParams['mathtext.fontset']='cm'
Times New Roman + SimSun + WFM Sans SC
simsum宋体, times new roman -*, simhei黑体, kaiti楷体,
dengxian等线, fangsong仿宋, Microsoft Yahei微软雅黑
plt.rcParams['axes.unicode_minus']=False
plt.rcParams['figure.dpi'] = 200
plt.rcParams['figure.figsize'] = [4, 3]
plt.rcParams['font.size'] = 12
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
u = np.linspace(0,2np.pi,50)
v = np.linspace(-np.pi/2,np.pi/2,50)
u, v = np.meshgrid(u, v)
x = 2np.cosh(v)np.cos(u)
y = np.sqrt(10)np.cosh(v)np.sin(u)
z = 2np.sqrt(2)*np.sinh(v)
fig = plt.figure(dpi=300)
ax = fig.add_subplot(projection='3d')
ax.plot_surface(x, y, z, cmap='ocean')
plt.show()