작동 순서( work sequence)
파이썬 matplotlib를 사용하여, CSV 파일에서 좌표 데이터를 읽은 후 차트를 모니터에그린다.
실행결과 화면( work result)

준비물(Supplies)
- CSV file : 저장 양식(format) x,z 좌표 값

- 파이썬(python) matplotlib
소스코드(Source code)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import csv | |
x=[] | |
z=[] | |
f= open("data.csv") | |
#append values to list | |
for row in csv.reader(f): | |
x.append(row[0]) | |
z.append(row[1]) | |
plt.plot(x, z, 'r.') | |
plt.axis([-1, 30, -5,1 ]) | |
plt.show() |
'소프트웨어 > 파이썬' 카테고리의 다른 글
[파이썬] Pyvisa 사용하여 GPIB 제어 (0) | 2021.01.28 |
---|---|
[파이썬] 점과 점 사이의 거리 계산하기 구하기 (0) | 2020.07.14 |
[파이썬] 테트리스 소스 코드 알고리즘 분석 (2) | 2020.06.24 |