2020. 2. 23. 22:49
- http://www.gnuplot.info/
- gnuplot 을 이용하는 이유?
- 센서 데이터를 모아서 전체적인 데이터의 흐름을 파악하기 위해
- 센서 출력값을 파일에 저장후 그래프로 출력
- 설치
- sudo apt-get install gnuplot-x11
- 텍스트 파일을 만들어 테스트 해보기
- wget https://bitbucket.org/MattHawkinsUK/rpispy-misc/raw/master/gnuplot/gnuplot_generate_data.py
- python gnuplot_generate_data.py
- #gnuplot
- gnuplot> plot "data.dat" using 1:2 t "Col1", "data.dat" using 1:3 t "col2";
- or you can use plot.gplt script (most sensor vendors supply this script)
- # 그래프를 그릴 윈도우의 크기를 정함
- set terminal wxt size 1500, 500
- # Y 축 라벨 이름
- set ylabel "Voltage"
- # X 축 라벨 이름
- set xlabel "Time"
- # 그래프 출력
- pot "mcp3008.dat" using 1:2 lc rgb '#ff0000' lt 1 lw 2 t "Digital"
- # 사용자의 입력을 받으면 프로그램 중단
- pause -1 "Hit return to continut"
- gnuplot plot.gplt