欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

python用matplotlib作图,图表样式详细设置

程序员文章站 2022-03-21 13:52:11
...

python中matplotlib可视化作图

最近做实验,需要重复画图,用origin处理有些繁琐,索性用python自动化处理一下。好在测试数据是简单的格式,不需要特定软件打开,记事本即可。
在文件解析获取数据上,没费什么事,但因为对作图格式有一定要求,所以在图表样式上碰到了一些问题。
官网的文档过于零碎,不适合新手阅读。网上的教程或视频较少,涉及样式的内容就更少,看来看去没有现成的优质教程,都没有对样式进行细致讲解。费了些时间依靠网上零碎的东西集成了今天的这篇文章。
贴出的代码,对作图分析里的要求没有完全实现。不过最后的效果还能接受。

代码实现

'''
作图分析
1、图像X、Y轴比例
2、X、Y轴刻度分布
3、刻度线长度、宽度
4、刻度标签字体大小
5、X、Y轴标签字体大小
6、图例边框去除
7、背景颜色设置
'''

import os
import numpy as np
import matplotlib.pyplot as plt
#从pyplot导入MultipleLocator类,这个类用于设置刻度间隔
from matplotlib.ticker import (MultipleLocator, AutoMinorLocator)

#解决中文显示问题
plt.rcParams['font.sans-serif'] =['Microsoft YaHei']
plt.rcParams['axes.unicode_minus'] = False

#获取需要处理文件的地址
def getlink():
    file_link_lists = []
    for file_link in os.listdir():
        if ".DTA" == os.path.splitext(file_link)[-1]:
            file_link_lists.append(file_link)
    return file_link_lists



#根据源文件数据处理,下一步进行绘制
def lsv_data_processing(file_link):
    result = [x_RHE[],y[]]
    keyword = r"V vs. Ref"
    with open(file_link,"r") as f:
        switch = 0
        for i, line in enumerate(f, 1): 
            if keyword in line:
                switch = 1
                continue
            if switch:
                x_RHE.append(eval(line.split("\t")[3])+0.059*14+0.244)
                y.append(eval(line.split("\t")[4])*1000)
        f.close()
    return result



#设置绘图样式
def draw_style(ax):
#设置坐标轴显示状态
    ax.spines['top'].set_visible(True)#开启上坐标轴
    ax.spines['bottom'].set_visible(True)#开启x轴坐标轴
    ax.spines['left'].set_visible(True)#开启y轴
    ax.spines['right'].set_visible(True)#开启右轴

#设置坐标轴的粗细
    width = 1.5
    ax.spines['bottom'].set_linewidth(width);
    ax.spines['left'].set_linewidth(width);
    ax.spines['right'].set_linewidth(width);
    ax.spines['top'].set_linewidth(width);

#坐标轴刻度间隔及刻度线样式
    y_major_locator = 50
    y_minor_locator = y_major_locator/2
    x_major_locator = 0.1
    x_minor_locator = x_major_locator/2
    ax.xaxis.set_major_locator(MultipleLocator(x_major_locator))
    ax.xaxis.set_minor_locator(MultipleLocator(x_minor_locator))
    ax.yaxis.set_major_locator(MultipleLocator(y_major_locator))
    ax.yaxis.set_minor_locator(MultipleLocator(y_minor_locator))

    ax.tick_params(axis='both', which = 'major', direction='out', length=8, width = 1.5)
    ax.tick_params(axis='both', which = 'minor', direction='out', length=4, width = 1.5)

#设置坐标轴范围
    x_range = (-0.5, 0)
    y_range = (-300, 10)
    ax.set_xlim(x_range)
    ax.set_ylim(y_range)

#设置坐标轴标签及样式
    x_label = "Potential  (V vs RHE)"
    y_label = "Current Density  (mA/cm$^2$)"
    label_fontsize = 14
    label_font =dict(fontsize=16, family='Times New Roman', weight='light')
    ax.set_xlabel(x_label, fontsize = label_fontsize, fontdict = label_font)
    ax.set_ylabel(y_label, fontsize = label_fontsize, fontdict = label_font)

def LSV_plot():
    fig = plt.figure()
    ax = plt.gca()
    draw_style(ax)
    i = 0
    line_color = ['#FE0000', '#FE8300', '#008300', '#FEFE00', '#0000FE', '#000000']
    for file_link in getlink():
        x_RHE = lsv_data_processing(file_link)[0]
        y = lsv_data_processing(file_link)[1]
        y_legend = file_link.split("-test", 1)[0]
        ax.plot(x_RHE, y, label = y_legend,linewidth=2.5, linestyle="-",color = line_color[i])
        i = i+1
    plt.legend()
    plt.show()


if __name__ == "__main__":
    LSV_plot()

附上测试数据

原文件中空格为tab键空格,非space空格,因为字符串分割需要用到请注意
文件命名保存为 123-test.DTA即可(注意DTA大写,大小写敏感)

CURVE TABLE 501
Pt T Vf Im Vu Sig Ach IERange Over Cycle Temp
# s V vs. Ref. A V V V # bits # deg C
203 102 -1.20310E+000 -1.54850E-002 0.00000E+000 -1.20300E+000 0.00000E+000 12 … 0 1473.68
204 102.5 -1.20412E+000 -1.56983E-002 0.00000E+000 -1.20400E+000 0.00000E+000 12 … 0 1473.68
205 103 -1.20512E+000 -1.59172E-002 0.00000E+000 -1.20500E+000 0.00000E+000 12 … 0 1473.68
206 103.5 -1.20611E+000 -1.61291E-002 0.00000E+000 -1.20600E+000 0.00000E+000 12 … 0 1473.68
207 104 -1.20712E+000 -1.63419E-002 0.00000E+000 -1.20700E+000 0.00000E+000 12 … 0 1473.68
208 104.5 -1.20812E+000 -1.65501E-002 0.00000E+000 -1.20800E+000 0.00000E+000 12 … 0 1473.68
209 105 -1.20910E+000 -1.67936E-002 0.00000E+000 -1.20900E+000 0.00000E+000 12 … 0 1473.68
210 105.5 -1.21009E+000 -1.70142E-002 0.00000E+000 -1.21000E+000 0.00000E+000 12 … 0 1473.68
211 106 -1.21111E+000 -1.72316E-002 0.00000E+000 -1.21100E+000 0.00000E+000 12 … 0 1473.68
212 106.5 -1.21211E+000 -1.74654E-002 0.00000E+000 -1.21200E+000 0.00000E+000 12 … 0 1473.68
213 107 -1.21309E+000 -1.77023E-002 0.00000E+000 -1.21300E+000 0.00000E+000 12 … 0 1473.68
214 107.5 -1.21410E+000 -1.79337E-002 0.00000E+000 -1.21400E+000 0.00000E+000 12 … 0 1473.68
215 108 -1.21510E+000 -1.81850E-002 0.00000E+000 -1.21500E+000 0.00000E+000 12 … 0 1473.68
216 108.5 -1.21610E+000 -1.84333E-002 0.00000E+000 -1.21600E+000 0.00000E+000 12 … 0 1473.68
217 109 -1.21713E+000 -1.86837E-002 0.00000E+000 -1.21700E+000 0.00000E+000 12 … 0 1473.68
218 109.5 -1.21812E+000 -1.89355E-002 0.00000E+000 -1.21799E+000 0.00000E+000 12 … 0 1473.68
219 110 -1.21910E+000 -1.91723E-002 0.00000E+000 -1.21899E+000 0.00000E+000 12 … 0 1473.68
220 110.5 -1.22013E+000 -1.94513E-002 0.00000E+000 -1.21999E+000 0.00000E+000 12 … 0 1473.68
221 111 -1.22111E+000 -1.97100E-002 0.00000E+000 -1.22099E+000 0.00000E+000 12 … 0 1473.68
222 111.5 -1.22210E+000 -1.99577E-002 0.00000E+000 -1.22199E+000 0.00000E+000 12 … 0 1473.68
223 112 -1.22312E+000 -2.02153E-002 0.00000E+000 -1.22299E+000 0.00000E+000 12 … 0 1473.68
224 112.5 -1.22412E+000 -2.04989E-002 0.00000E+000 -1.22401E+000 0.00000E+000 12 … 0 1473.68
225 113 -1.22511E+000 -2.07707E-002 0.00000E+000 -1.22501E+000 0.00000E+000 12 … 0 1473.68
226 113.5 -1.22612E+000 -2.10239E-002 0.00000E+000 -1.22601E+000 0.00000E+000 12 … 0 1473.68
227 114 -1.22712E+000 -2.12893E-002 0.00000E+000 -1.22701E+000 0.00000E+000 12 … 0 1473.68
228 114.5 -1.22812E+000 -2.15651E-002 0.00000E+000 -1.22800E+000 0.00000E+000 12 … 0 1473.68
229 115 -1.22910E+000 -2.18411E-002 0.00000E+000 -1.22900E+000 0.00000E+000 12 … 0 1473.68
230 115.5 -1.23012E+000 -2.21219E-002 0.00000E+000 -1.23000E+000 0.00000E+000 12 … 0 1473.68
231 116 -1.23113E+000 -2.23802E-002 0.00000E+000 -1.23100E+000 0.00000E+000 12 … 0 1473.68
232 116.5 -1.23211E+000 -2.26643E-002 0.00000E+000 -1.23200E+000 0.00000E+000 12 … 0 1473.68
233 117 -1.23312E+000 -2.29402E-002 0.00000E+000 -1.23300E+000 0.00000E+000 12 … 0 1473.68
234 117.5 -1.23412E+000 -2.32145E-002 0.00000E+000 -1.23400E+000 0.00000E+000 12 … 0 1473.68
235 118 -1.23511E+000 -2.35159E-002 0.00000E+000 -1.23500E+000 0.00000E+000 12 … 0 1473.68
236 118.5 -1.23612E+000 -2.37962E-002 0.00000E+000 -1.23600E+000 0.00000E+000 12 … 0 1473.68
237 119 -1.23712E+000 -2.40706E-002 0.00000E+000 -1.23700E+000 0.00000E+000 12 … 0 1473.68
238 119.5 -1.23812E+000 -2.43644E-002 0.00000E+000 -1.23800E+000 0.00000E+000 12 … 0 1473.68
239 120 -1.23911E+000 -2.46681E-002 0.00000E+000 -1.23900E+000 0.00000E+000 12 … 0 1473.68
240 120.5 -1.24011E+000 -2.49582E-002 0.00000E+000 -1.24000E+000 0.00000E+000 12 … 0 1473.68
241 121 -1.24111E+000 -2.52668E-002 0.00000E+000 -1.24100E+000 0.00000E+000 12 … 0 1473.68
242 121.5 -1.24209E+000 -2.55689E-002 0.00000E+000 -1.24200E+000 0.00000E+000 12 … 0 1473.68
243 122 -1.24312E+000 -2.58833E-002 0.00000E+000 -1.24300E+000 0.00000E+000 12 … 0 1473.68
244 122.5 -1.24412E+000 -2.61862E-002 0.00000E+000 -1.24400E+000 0.00000E+000 12 … 0 1473.68
245 123 -1.24512E+000 -2.65007E-002 0.00000E+000 -1.24500E+000 0.00000E+000 12 … 0 1473.68
246 123.5 -1.24611E+000 -2.68069E-002 0.00000E+000 -1.24600E+000 0.00000E+000 12 … 0 1473.68
247 124 -1.24711E+000 -2.71123E-002 0.00000E+000 -1.24700E+000 0.00000E+000 12 … 0 1473.68
248 124.5 -1.24810E+000 -2.74516E-002 0.00000E+000 -1.24800E+000 0.00000E+000 12 … 0 1473.68
249 125 -1.24910E+000 -2.77613E-002 0.00000E+000 -1.24900E+000 0.00000E+000 12 … 0 1473.68
250 125.5 -1.25013E+000 -2.80841E-002 0.00000E+000 -1.25000E+000 0.00000E+000 12 … 0 1473.68
251 126 -1.25110E+000 -2.84118E-002 0.00000E+000 -1.25100E+000 0.00000E+000 12 … 0 1473.68
252 126.5 -1.25210E+000 -2.87374E-002 0.00000E+000 -1.25200E+000 0.00000E+000 12 … 0 1473.68
253 127 -1.25310E+000 -2.90763E-002 0.00000E+000 -1.25300E+000 0.00000E+000 12 … 0 1473.68
254 127.5 -1.25411E+000 -2.93900E-002 0.00000E+000 -1.25400E+000 0.00000E+000 12 … 0 1473.68
255 128 -1.25514E+000 -2.97286E-002 0.00000E+000 -1.25500E+000 0.00000E+000 12 … 0 1473.68
256 128.5 -1.25614E+000 -3.00718E-002 0.00000E+000 -1.25600E+000 0.00000E+000 12 … 0 1473.68
257 129 -1.25712E+000 -3.04037E-002 0.00000E+000 -1.25700E+000 0.00000E+000 12 … 0 1473.68
258 129.5 -1.25812E+000 -3.07504E-002 0.00000E+000 -1.25800E+000 0.00000E+000 12 … 0 1473.68
259 130 -1.25911E+000 -3.11112E-002 0.00000E+000 -1.25900E+000 0.00000E+000 12 … 0 1473.68
260 130.5 -1.26010E+000 -3.14349E-002 0.00000E+000 -1.26000E+000 0.00000E+000 12 … 0 1473.68
261 131 -1.26110E+000 -3.18116E-002 0.00000E+000 -1.26100E+000 0.00000E+000 12 … 0 1473.68
262 131.5 -1.26210E+000 -3.21485E-002 0.00000E+000 -1.26200E+000 0.00000E+000 12 … 0 1473.68
263 132 -1.26311E+000 -3.25110E-002 0.00000E+000 -1.26300E+000 0.00000E+000 12 … 0 1473.68
264 132.5 -1.26409E+000 -3.28613E-002 0.00000E+000 -1.26400E+000 0.00000E+000 12 … 0 1473.68
265 133 -1.26509E+000 -3.32362E-002 0.00000E+000 -1.26500E+000 0.00000E+000 12 … 0 1473.68
266 133.5 -1.26609E+000 -3.35876E-002 0.00000E+000 -1.26600E+000 0.00000E+000 12 … 0 1473.68
267 134 -1.26709E+000 -3.39525E-002 0.00000E+000 -1.26699E+000 0.00000E+000 12 … 0 1473.68
268 134.5 -1.26812E+000 -3.43155E-002 0.00000E+000 -1.26799E+000 0.00000E+000 12 … 0 1473.68
269 135 -1.26910E+000 -3.46864E-002 0.00000E+000 -1.26899E+000 0.00000E+000 12 … 0 1473.68
270 135.5 -1.27011E+000 -3.50432E-002 0.00000E+000 -1.26999E+000 0.00000E+000 12 … 0 1473.68
271 136 -1.27113E+000 -3.54256E-002 0.00000E+000 -1.27099E+000 0.00000E+000 12 … 0 1473.68
272 136.5 -1.27211E+000 -3.58125E-002 0.00000E+000 -1.27199E+000 0.00000E+000 12 … 0 1473.68
273 137 -1.27310E+000 -3.61958E-002 0.00000E+000 -1.27299E+000 0.00000E+000 12 … 0 1473.68
274 137.5 -1.27411E+000 -3.65904E-002 0.00000E+000 -1.27401E+000 0.00000E+000 12 … 0 1473.68
275 138 -1.27511E+000 -3.69501E-002 0.00000E+000 -1.27501E+000 0.00000E+000 12 … 0 1473.68
276 138.5 -1.27612E+000 -3.73189E-002 0.00000E+000 -1.27601E+000 0.00000E+000 12 … 0 1473.68
277 139 -1.27712E+000 -3.77195E-002 0.00000E+000 -1.27700E+000 0.00000E+000 12 … 0 1473.68
278 139.5 -1.27810E+000 -3.81166E-002 0.00000E+000 -1.27800E+000 0.00000E+000 12 … 0 1473.68
279 140 -1.27912E+000 -3.85059E-002 0.00000E+000 -1.27900E+000 0.00000E+000 12 … 0 1473.68
280 140.5 -1.28012E+000 -3.89028E-002 0.00000E+000 -1.28000E+000 0.00000E+000 12 … 0 1473.68
281 141 -1.28114E+000 -3.92743E-002 0.00000E+000 -1.28100E+000 0.00000E+000 12 … 0 1473.68
282 141.5 -1.28212E+000 -3.96622E-002 0.00000E+000 -1.28200E+000 0.00000E+000 12 … 0 1473.68
283 142 -1.28311E+000 -4.00683E-002 0.00000E+000 -1.28300E+000 0.00000E+000 12 … 0 1473.68
284 142.5 -1.28413E+000 -4.04786E-002 0.00000E+000 -1.28400E+000 0.00000E+000 12 … 0 1473.68
285 143 -1.28512E+000 -4.08777E-002 0.00000E+000 -1.28500E+000 0.00000E+000 12 … 0 1473.68
286 143.5 -1.28610E+000 -4.12688E-002 0.00000E+000 -1.28600E+000 0.00000E+000 12 … 0 1473.68
287 144 -1.28710E+000 -4.16874E-002 0.00000E+000 -1.28700E+000 0.00000E+000 12 … 0 1473.68
288 144.5 -1.28811E+000 -4.21258E-002 0.00000E+000 -1.28800E+000 0.00000E+000 12 … 0 1473.68
289 145 -1.28911E+000 -4.25203E-002 0.00000E+000 -1.28900E+000 0.00000E+000 12 … 0 1473.68
290 145.5 -1.29011E+000 -4.29360E-002 0.00000E+000 -1.29000E+000 0.00000E+000 12 … 0 1473.68
291 146 -1.29111E+000 -4.33419E-002 0.00000E+000 -1.29100E+000 0.00000E+000 12 … 0 1473.68
292 146.5 -1.29210E+000 -4.37684E-002 0.00000E+000 -1.29200E+000 0.00000E+000 12 … 0 1473.68
293 147 -1.29309E+000 -4.41655E-002 0.00000E+000 -1.29300E+000 0.00000E+000 12 … 0 1473.68
294 147.5 -1.29412E+000 -4.45709E-002 0.00000E+000 -1.29400E+000 0.00000E+000 12 … 0 1473.68
295 148 -1.29511E+000 -4.49837E-002 0.00000E+000 -1.29500E+000 0.00000E+000 12 … 0 1473.68
296 148.5 -1.29611E+000 -4.54188E-002 0.00000E+000 -1.29600E+000 0.00000E+000 12 … 0 1473.68
297 149 -1.29712E+000 -4.58587E-002 0.00000E+000 -1.29700E+000 0.00000E+000 12 … 0 1473.68
298 149.5 -1.29810E+000 -4.62795E-002 0.00000E+000 -1.29800E+000 0.00000E+000 12 … 0 1473.68
299 150 -1.29912E+000 -4.67136E-002 0.00000E+000 -1.29900E+000 0.00000E+000 12 … 0 1473.68
300 150.5 -1.30011E+000 -4.71624E-002 0.00000E+000 -1.30000E+000 0.00000E+000 12 … 0 1473.68
301 151 -1.30112E+000 -4.75888E-002 0.00000E+000 -1.30100E+000 0.00000E+000 12 … 0 1473.68
302 151.5 -1.30211E+000 -4.80362E-002 0.00000E+000 -1.30200E+000 0.00000E+000 12 … 0 1473.68
303 152 -1.30311E+000 -4.84555E-002 0.00000E+000 -1.30300E+000 0.00000E+000 12 … 0 1473.68
304 152.5 -1.30410E+000 -4.89022E-002 0.00000E+000 -1.30400E+000 0.00000E+000 12 … 0 1473.68
305 153 -1.30510E+000 -4.93551E-002 0.00000E+000 -1.30500E+000 0.00000E+000 12 … 0 1473.68
306 153.5 -1.30610E+000 -4.97954E-002 0.00000E+000 -1.30600E+000 0.00000E+000 12 … 0 1473.68
307 154 -1.30711E+000 -5.02163E-002 0.00000E+000 -1.30700E+000 0.00000E+000 12 … 0 1473.59
308 154.5 -1.30811E+000 -5.06758E-002 0.00000E+000 -1.30800E+000 0.00000E+000 12 … 0 1473.59
309 155 -1.30910E+000 -5.11288E-002 0.00000E+000 -1.30900E+000 0.00000E+000 12 … 0 1473.59
310 155.5 -1.31012E+000 -5.15840E-002 0.00000E+000 -1.31000E+000 0.00000E+000 12 … 0 1473.59
311 156 -1.31110E+000 -5.20231E-002 0.00000E+000 -1.31100E+000 0.00000E+000 12 … 0 1473.68
312 156.5 -1.31210E+000 -5.24767E-002 0.00000E+000 -1.31200E+000 0.00000E+000 12 … 0 1473.68
313 157 -1.31311E+000 -5.29379E-002 0.00000E+000 -1.31300E+000 0.00000E+000 12 … 0 1473.68
314 157.5 -1.31411E+000 -5.33900E-002 0.00000E+000 -1.31400E+000 0.00000E+000 12 … 0 1473.68
315 158 -1.31510E+000 -5.38232E-002 0.00000E+000 -1.31500E+000 0.00000E+000 12 … 0 1473.68
316 158.5 -1.31610E+000 -5.42947E-002 0.00000E+000 -1.31599E+000 0.00000E+000 12 … 0 1473.68
317 159 -1.31710E+000 -5.47769E-002 0.00000E+000 -1.31699E+000 0.00000E+000 12 … 0 1473.68
318 159.5 -1.31809E+000 -5.52139E-002 0.00000E+000 -1.31799E+000 0.00000E+000 12 … 0 1473.68
319 160 -1.31913E+000 -5.56718E-002 0.00000E+000 -1.31899E+000 0.00000E+000 12 … 0 1473.68
320 160.5 -1.32010E+000 -5.61347E-002 0.00000E+000 -1.31999E+000 0.00000E+000 12 … 0 1473.68
321 161 -1.32110E+000 -5.65944E-002 0.00000E+000 -1.32099E+000 0.00000E+000 12 … 0 1473.68
322 161.5 -1.32210E+000 -5.70683E-002 0.00000E+000 -1.32199E+000 0.00000E+000 12 … 0 1473.68
323 162 -1.32313E+000 -5.75247E-002 0.00000E+000 -1.32301E+000 0.00000E+000 12 … 0 1473.68
324 162.5 -1.32410E+000 -5.79874E-002 0.00000E+000 -1.32401E+000 0.00000E+000 12 … 0 1473.68
325 163 -1.32510E+000 -5.84514E-002 0.00000E+000 -1.32501E+000 0.00000E+000 12 … 0 1473.68
326 163.5 -1.32611E+000 -5.89056E-002 0.00000E+000 -1.32600E+000 0.00000E+000 12 … 0 1473.68
327 164 -1.32712E+000 -5.93734E-002 0.00000E+000 -1.32700E+000 0.00000E+000 12 … 0 1473.59
328 164.5 -1.32811E+000 -5.98513E-002 0.00000E+000 -1.32800E+000 0.00000E+000 12 … 0 1473.59
329 165 -1.32910E+000 -6.03100E-002 0.00000E+000 -1.32900E+000 0.00000E+000 12 … 0 1473.68
330 165.5 -1.33011E+000 -6.07605E-002 0.00000E+000 -1.33000E+000 0.00000E+000 12 … 0 1473.68
331 166 -1.33110E+000 -6.12410E-002 0.00000E+000 -1.33100E+000 0.00000E+000 12 … 0 1473.68
332 166.5 -1.33212E+000 -6.17123E-002 0.00000E+000 -1.33200E+000 0.00000E+000 12 … 0 1473.68
333 167 -1.33312E+000 -6.21847E-002 0.00000E+000 -1.33300E+000 0.00000E+000 12 … 0 1473.68
334 167.5 -1.33411E+000 -6.26819E-002 0.00000E+000 -1.33400E+000 0.00000E+000 12 … 0 1473.68
335 168 -1.33511E+000 -6.31235E-002 0.00000E+000 -1.33500E+000 0.00000E+000 12 … 0 1473.68
336 168.5 -1.33610E+000 -6.36276E-002 0.00000E+000 -1.33600E+000 0.00000E+000 12 … 0 1473.68
337 169 -1.33709E+000 -6.41189E-002 0.00000E+000 -1.33700E+000 0.00000E+000 12 … 0 1473.68
338 169.5 -1.33810E+000 -6.46015E-002 0.00000E+000 -1.33800E+000 0.00000E+000 12 … 0 1473.68
339 170 -1.33911E+000 -6.50796E-002 0.00000E+000 -1.33900E+000 0.00000E+000 12 … 0 1473.68
340 170.5 -1.34009E+000 -6.55667E-002 0.00000E+000 -1.34000E+000 0.00000E+000 12 … 0 1473.68
341 171 -1.34109E+000 -6.60281E-002 0.00000E+000 -1.34100E+000 0.00000E+000 12 … 0 1473.59
342 171.5 -1.34209E+000 -6.65169E-002 0.00000E+000 -1.34200E+000 0.00000E+000 12 … 0 1473.59
343 172 -1.34310E+000 -6.70167E-002 0.00000E+000 -1.34300E+000 0.00000E+000 12 … 0 1473.68
344 172.5 -1.34409E+000 -6.75080E-002 0.00000E+000 -1.34400E+000 0.00000E+000 12 … 0 1473.68
345 173 -1.34510E+000 -6.79830E-002 0.00000E+000 -1.34500E+000 0.00000E+000 12 … 0 1473.68
346 173.5 -1.34610E+000 -6.84882E-002 0.00000E+000 -1.34600E+000 0.00000E+000 12 … 0 1473.68
347 174 -1.34711E+000 -6.89582E-002 0.00000E+000 -1.34700E+000 0.00000E+000 12 … 0 1473.68
348 174.5 -1.34810E+000 -6.94434E-002 0.00000E+000 -1.34800E+000 0.00000E+000 12 … 0 1473.68
349 175 -1.34909E+000 -6.99212E-002 0.00000E+000 -1.34900E+000 0.00000E+000 12 … 0 1473.68
350 175.5 -1.35009E+000 -7.04344E-002 0.00000E+000 -1.35000E+000 0.00000E+000 12 … 0 1473.68
351 176 -1.35110E+000 -7.09262E-002 0.00000E+000 -1.35100E+000 0.00000E+000 12 … 0 1473.68
352 176.5 -1.35210E+000 -7.14270E-002 0.00000E+000 -1.35200E+000 0.00000E+000 12 … 0 1473.68
353 177 -1.35310E+000 -7.18958E-002 0.00000E+000 -1.35300E+000 0.00000E+000 12 … 0 1473.68
354 177.5 -1.35411E+000 -7.23965E-002 0.00000E+000 -1.35400E+000 0.00000E+000 12 … 0 1473.68
355 178 -1.35509E+000 -7.28967E-002 0.00000E+000 -1.35500E+000 0.00000E+000 12 … 0 1473.68
356 178.5 -1.35608E+000 -7.33933E-002 0.00000E+000 -1.35600E+000 0.00000E+000 12 … 0 1473.68
357 179 -1.35708E+000 -7.39099E-002 0.00000E+000 -1.35700E+000 0.00000E+000 12 … 0 1473.68
358 179.5 -1.35812E+000 -7.44046E-002 0.00000E+000 -1.35800E+000 0.00000E+000 12 … 0 1473.68
359 180 -1.35910E+000 -7.48957E-002 0.00000E+000 -1.35900E+000 0.00000E+000 12 … 0 1473.68
360 180.5 -1.36010E+000 -7.54082E-002 0.00000E+000 -1.36000E+000 0.00000E+000 12 … 0 1473.68
361 181 -1.36111E+000 -7.58799E-002 0.00000E+000 -1.36100E+000 0.00000E+000 12 … 0 1473.68
362 181.5 -1.36208E+000 -7.63913E-002 0.00000E+000 -1.36200E+000 0.00000E+000 12 … 0 1473.68
363 182 -1.36310E+000 -7.68964E-002 0.00000E+000 -1.36300E+000 0.00000E+000 12 … 0 1473.68
364 182.5 -1.36409E+000 -7.73963E-002 0.00000E+000 -1.36400E+000 0.00000E+000 12 … 0 1473.68
365 183 -1.36509E+000 -7.78871E-002 0.00000E+000 -1.36499E+000 0.00000E+000 12 … 0 1473.68
366 183.5 -1.36610E+000 -7.83850E-002 0.00000E+000 -1.36599E+000 0.00000E+000 12 … 0 1473.68
367 184 -1.36707E+000 -7.88987E-002 0.00000E+000 -1.36699E+000 0.00000E+000 12 … 0 1473.68
368 184.5 -1.36809E+000 -7.93868E-002 0.00000E+000 -1.36799E+000 0.00000E+000 12 … 0 1473.68
369 185 -1.36908E+000 -7.98962E-002 0.00000E+000 -1.36899E+000 0.00000E+000 12 … 0 1473.68
370 185.5 -1.37009E+000 -8.03758E-002 0.00000E+000 -1.36999E+000 0.00000E+000 12 … 0 1473.68
371 186 -1.37111E+000 -8.08649E-002 0.00000E+000 -1.37099E+000 0.00000E+000 12 … 0 1473.68
372 186.5 -1.37210E+000 -8.13759E-002 0.00000E+000 -1.37199E+000 0.00000E+000 12 … 0 1473.68
373 187 -1.37312E+000 -8.18882E-002 0.00000E+000 -1.37301E+000 0.00000E+000 12 … 0 1473.59
374 187.5 -1.37411E+000 -8.23766E-002 0.00000E+000 -1.37401E+000 0.00000E+000 12 … 0 1473.59
375 188 -1.37512E+000 -8.28647E-002 0.00000E+000 -1.37500E+000 0.00000E+000 12 … 0 1473.68
376 188.5 -1.37610E+000 -8.33610E-002 0.00000E+000 -1.37600E+000 0.00000E+000 12 … 0 1473.68
377 189 -1.37709E+000 -8.38850E-002 0.00000E+000 -1.37700E+000 0.00000E+000 12 … 0 1473.68
378 189.5 -1.37812E+000 -8.44060E-002 0.00000E+000 -1.37800E+000 0.00000E+000 12 … 0 1473.68
379 190 -1.37910E+000 -8.49056E-002 0.00000E+000 -1.37900E+000 0.00000E+000 12 … 0 1473.68
380 190.5 -1.38008E+000 -8.54062E-002 0.00000E+000 -1.38000E+000 0.00000E+000 12 … 0 1473.68
381 191 -1.38110E+000 -8.59411E-002 0.00000E+000 -1.38100E+000 0.00000E+000 12 … 0 1473.68
382 191.5 -1.38209E+000 -8.64303E-002 0.00000E+000 -1.38200E+000 0.00000E+000 12 … 0 1473.68
383 192 -1.38309E+000 -8.69487E-002 0.00000E+000 -1.38300E+000 0.00000E+000 12 … 0 1473.68
384 192.5 -1.38411E+000 -8.74441E-002 0.00000E+000 -1.38400E+000 0.00000E+000 12 … 0 1473.68
385 193 -1.38510E+000 -8.79562E-002 0.00000E+000 -1.38500E+000 0.00000E+000 12 … 0 1473.68
386 193.5 -1.38611E+000 -8.84741E-002 0.00000E+000 -1.38600E+000 0.00000E+000 12 … 0 1473.68
387 194 -1.38710E+000 -8.89979E-002 0.00000E+000 -1.38700E+000 0.00000E+000 12 … 0 1473.68
388 194.5 -1.38811E+000 -8.95062E-002 0.00000E+000 -1.38800E+000 0.00000E+000 12 … 0 1473.68
389 195 -1.38910E+000 -9.00279E-002 0.00000E+000 -1.38900E+000 0.00000E+000 12 … 0 1473.68
390 195.5 -1.39010E+000 -9.05582E-002 0.00000E+000 -1.39000E+000 0.00000E+000 12 … 0 1473.68
391 196 -1.39111E+000 -9.10802E-002 0.00000E+000 -1.39100E+000 0.00000E+000 12 … 0 1473.68
392 196.5 -1.39210E+000 -9.16037E-002 0.00000E+000 -1.39200E+000 0.00000E+000 12 … 0 1473.68

遗留问题

只有一个问题python导出的图片过大,设置DPI=500时保存生成的图片接近百兆字节,这个问题网上搜了搜也没能解决,估计最后还是要靠origin

欢迎转载和关注