import matplotlib.pyplot as plt
import numpy as np
from matplotlib import rcParams
# print(plt.style.available) # 查看可选择的样式
figsize = (5, 2.9)
title_size = 10
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
time = np.arange(1, 8).reshape(7).tolist()
fig = plt.figure(figsize=figsize)
ax = fig.add_subplot(111)
ax.plot(time, time)
ax.spines['right'].set_visible(False) # 去掉边框
ax.spines['top'].set_visible(False) # 去掉边框
ax.grid(zorder=1, axis='y')
plt.show()
【记录】python画图样式选择,去边框
最新推荐文章于 2024-03-09 16:38:48 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)