G N U P L O T Version 5.4 patchlevel 2 last modified 2021-06-01
Copyright (C) 1986-1993, 1998, 2004, 2007-2021 Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info faq, bugs, etc: type "help FAQ" immediate help: type "help" (plot window: hit 'h')
Terminal type is now 'qt' gnuplot> splot [2:-1] [-1:2] 3*x**2 + 2y**2 Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
gnuplot> splot [2:-1] [-1:2] 3*x**2 + 2y**2 ^ unexpected or unrecognized token: y
gnuplot> quit
아무튼 이쁘게 잘 그려준다.
csv 파일을 그리려면 ,를 구분자로 설정해주면 되고
set datafile separator ',' plot "test.csv" using 0:1 with lines
stackoverflow에 내용을 참조해서 도움말을 보니 column("컬럼명") 혹은 column("컬럼 번호") 로 쓰는데
인덱스는 0부터가 아니라 1부터 시작되는 듯
gnuplot> help plot datafile using // 생략 if the data file contains Height Weight Age val1 val1 val1 ... ... ... then the following plot commands are all equivalent plot 'datafile' using 3:1, '' using 3:2 plot 'datafile' using (column("Age")):(column(1)), \ '' using (column("Age")):(column(2)) plot 'datafile' using "Age":"Height", '' using "Age":"Weight"
그렇기에 (column(0)) 을 해주면 되는데 column(0)에러 난다.(!)
gnuplot> help plot datafile using pseudocolumns Expressions in the `using` clause of a plot statement can refer to additional bookkeeping values in addition to the actual data values contained in the input file. These are contained in "pseudocolumns". column(0) The sequential order of each point within a data set. The counter starts at 0, increments on each non-blank, non-comment line, and is reset by two sequential blank records. The shorthand form $0 is available. column(-1) This counter starts at 0, increments on a single blank line, and is reset by two sequential blank lines. This corresponds to the data line in array or grid data. It can also be used to distinguish separate line segments or polygons within a data set. column(-2) Starts at 0 and increments on two sequential blank lines. This is the index number of the current data set within a file that contains multiple data sets. See `index`. column($#) The special symbol $# evaluates to the total number of columns available, so column($#) refers to the last (rightmost) field in the current input line. column($# - 1) would refer to the last-but-one column, etc.
터미널 변경은 set terminal을 쓰면 된다.
$ gnuplot
G N U P L O T Version 5.4 patchlevel 2 last modified 2021-06-01
Copyright (C) 1986-1993, 1998, 2004, 2007-2021 Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info faq, bugs, etc: type "help FAQ" immediate help: type "help" (plot window: hit 'h')
Terminal type is now 'qt'
gnuplot> set terminal dumb Terminal type is now 'dumb' Options are 'feed size 79, 24 aspect 2, 1 mono'