1
0
This commit is contained in:
2024-08-10 23:29:37 +08:00
parent e881b78f3d
commit 176e643f20
8 changed files with 267 additions and 133 deletions

BIN
plt/arctanx&x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

29
plt/arctanx&x.py Normal file
View File

@@ -0,0 +1,29 @@
import numpy as np
import matplotlib.pyplot as plt
# 定义 x 的范围
x = np.linspace(-3, 3, 400)
# 计算 y 的值
y_arctan = np.arctan(x)
y_linear = x
# 绘制图形
plt.figure(figsize=(8, 6))
plt.plot(x, y_arctan, label='y = arctan(x)', color='blue')
plt.plot(x, y_linear, label='y = x', color='red', linestyle='--')
plt.xlabel('x')
plt.ylabel('y')
plt.title('Plot of y = arctan(x) and y = x')
# 获取当前坐标轴
ax = plt.gca()
# 设置 x 轴和 y 轴的线条粗细
ax.spines['bottom'].set_linewidth(2)
ax.spines['left'].set_linewidth(2)
plt.legend()
plt.grid(True) # 如果需要网格线,可以保留这行
plt.savefig('arctanx&x.png')
plt.show()

52
plt/style.mplstyle Normal file
View File

@@ -0,0 +1,52 @@
# Line properties
lines.linewidth: 4
lines.solid_capstyle: butt
# Legend properties
legend.fancybox: true
# Color and cycle properties
axes.prop_cycle: cycler('color', ['#0096FF', '#FF9300', '#FF40FF', '#7030A0', '#C00000'])
axes.facecolor: '#ffffff' # white
axes.labelsize: large
axes.axisbelow: true
axes.grid: False
axes.edgecolor: '#f0f0f0'
axes.linewidth: 3.0
axes.titlesize: x-large
# Patch properties
patch.edgecolor: '#f0f0f0'
patch.linewidth: 0.5
# SVG properties
svg.fonttype: path
# Grid properties
grid.linestyle: '-'
grid.linewidth: 1.0
grid.color: '#cbcbcb'
# Ticks properties
xtick.major.size: 0
xtick.minor.size: 0
ytick.major.size: 0
ytick.minor.size: 0
# Savefig properties
savefig.edgecolor: '#f0f0f0'
savefig.facecolor: '#f0f0f0'
# Figure properties
figure.facecolor: '#ffffff' # white
# Font properties
font.family: sans-serif
font.style: normal
font.variant: normal
font.weight: normal
font.stretch: normal
font.size: 8.0
# Text properties
text.color: black