'IT/메이커를 위한 라즈베리파이'에 해당되는 글 1건

  1. 2020.02.23 data monitoring through gnuplot
posted by 그물에걸리지않는바람처럼 2020. 2. 23. 22:49
  1. http://www.gnuplot.info/
  2. gnuplot 을 이용하는 이유?
    • 센서 데이터를 모아서 전체적인 데이터의 흐름을 파악하기 위해
    • 센서 출력값을 파일에 저장후 그래프로 출력
  3. 설치
    • sudo apt-get install gnuplot-x11
  4. 텍스트 파일을 만들어 테스트 해보기
    1. wget https://bitbucket.org/MattHawkinsUK/rpispy-misc/raw/master/gnuplot/gnuplot_generate_data.py
    2. python gnuplot_generate_data.py
    3. #gnuplot
      • gnuplot> plot "data.dat" using 1:2 t "Col1", "data.dat" using 1:3 t "col2";
    4. 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"
    5. gnuplot plot.gplt