1、流程:通过matplotlib生成eps,将eps转成emf,emf可以直接用于论文(emf 始终保持着图形的精度)
import numpy as np
import matplotlib.pyplot as plt
figsize = 11, 9
fig, ax = plt.subplots(figsize = figsize)
#1、获取数据
x = np.arange(1,10,1)
y = x**2 +3
#2、绘制曲线,设置曲线:颜色、宽度、形状
plt.plot(x,y,'r',label='Aline',linestyle=':', linewidth=5.0,ms=10)
#2、背景网格设置
#matplotlin.pyplot.grid(b, which, axis, color, linestyle, linewidth, **kwargs)axis轴线、color颜色、linestyle的类型, linewidth的宽度,
plt.grid( color = 'black',linestyle='-',linewidth = 0.2)
#3、边框设置:坐标轴的宽、颜色、
bwith = 4 #边框宽度设置为2
# ax = plt.gca()#获取边框
# ax.spines['top'].set_color('none') # 设置上‘脊梁’为红色
ax.spines['top'].set_color('black') # 设置上‘脊梁’为红色
ax.spines['right'].set_color('black') # 设置上‘脊梁’为无色
ax.spines['bottom