![gnuplot - 0행: 예상치 못한 또는 인식할 수 없는 토큰](https://linux55.com/image/153436/gnuplot%20-%200%ED%96%89%3A%20%EC%98%88%EC%83%81%EC%B9%98%20%EB%AA%BB%ED%95%9C%20%EB%98%90%EB%8A%94%20%EC%9D%B8%EC%8B%9D%ED%95%A0%20%EC%88%98%20%EC%97%86%EB%8A%94%20%ED%86%A0%ED%81%B0.png)
암호:
#!/usr/bin/env bash
# download death data
wget -O Deaths.txt http://www.randomservices.org/random/data/Deaths.txt
wget -O Pumps.txt http://www.randomservices.org/random/data/Pumps.txt
# Delete the first line
sed 1d Deaths.txt > tempfile1
sed 1d Pumps.txt > tempfile2
# mv tempfile1 Deaths.txt
# mv tempfile2 Pumps.txt
gnuplot -persist -e "set terminal canvas;set xlabel 'x' font 'sans,15';
set ylabel 'y' font ',15';
set title 'Relationship between Deaths and Pumps' font 'sans, 20';
show title;
set label "Most of the deaths is near the pump located in 12.6,11.7" at 16,16;
show label;
set output 'death_pump_relation.html';
plot 'Pumps.txt' with points pt 7 ,'Deaths.txt' with dots;"
오류가 있습니다:line 0: unexpected or unrecognized token
아무런 출력도 얻을 수 없습니다
하지만 사실 내 스크립트에는 line0이 없습니다.
이게 무슨 문제야?
버전: gnuplot V5.2
시스템: MacOS
답변1
이것은 작업 스크립트입니다
#!/usr/bin/env bash
# download death data
wget -O Deaths.txt http://www.randomservices.org/random/data/Deaths.txt
wget -O Pumps.txt http://www.randomservices.org/random/data/Pumps.txt
# Delete the first line
sed 1d Deaths.txt > tempfile1
sed 1d Pumps.txt > tempfile2
mv tempfile1 Deaths.txt
mv tempfile2 Pumps.txt
gnuplot -persist -e "set terminal canvas;set xlabel 'x' font 'sans,15';
set ylabel 'y' font ',15';
set title 'Relationship between Deaths and Pumps' font 'sans, 20';
show title;
set label 'Most of the deaths is near the pump located in 12.6,11.7' at 16,16;
show label;
set output 'death_pump_relation.html';
plot 'Pumps.txt' with points pt 7 ,'Deaths.txt' with dots;"
출력은 Death_pump_relation.html에 있습니다.
답변2
무슨 문제인지 알아
# mv tempfile1 Deaths.txt
# mv tempfile2 Pumps.txt
비판받아서는 안 된다