Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- git commit message
- linux bash
- Climbing Stairs
- Python Imaging Library
- apt autoremove
- vim set noshowmatch
- vim 치환
- gnuplot csv
- apt clean
- Leetcode 70
- Resolution Changing
- Leetcode 121
- VirtualBox
- vim 괄호 비활성화
- vi/vim commands
- 프로그래머스
- LaTeX figure
- vi/vim 명령어
- 프로그래머스 실패율
- 프로그래머스 구명보트
- linux prompt color
- latex 첨자
- python3
- without nohup.out
- 프로그래머스 체육복
- 걸쳐서 그림 넣기
- csv x range
- vim 찾아 바꾸기
- tensorflow model load
- url reference
Archives
- Today
- Total
기억노트
[GNUplot] 간단한 막대 그래프 그리기 본문
예제 코드
1. plot 파일
reset
set terminal png font 'arial, 11'
set output 'a.png'
set xtics ('0' 0, '10' 1, '20' 2, '30' 3, '40' 4)
set boxwidth 0.3
set xlabel 'X label'
set ylabel 'Y label'
set yrange [0.4:1]
set style fill pattern 2
set nokey
plot 'a.txt' with boxes lc rgbcolor 'black'
2. text 파일 (a.txt)
0.5
0.6
0.7
0.8
0.9
예제 코드 설명
reset
: 설정 초기화
set terminal png font 'arial, 11'
: 출력을 png 파일로 설정하고, 폰트는 arial에 글자 크기를 11로 설정
set output 'a.png'
: 결과를 a.png 파일로 출력(저장)
set xtics ('0' 0, '10' 1, '20' 2, '30' 3, '40' 4)
: x축의 항목을 '0', '10', '20', '30', '40' 으로 설정(0에 해당하는 위치에 0, 1에 해당하는 위치에 10, ...)
set boxwidth 0.3
: 막대 그래프의 넓이를 0.3으로 설정
set xlabel 'X label'
: x축 label을 'X label'로 설정
set ylabel 'Y label'
: y축 label을 'Y label'로 설정
set yrange [0.4:1]
: y축을 0.4에서 1까지 나타냄
set style fill pattern 2
: 막대 그래프의 채우기 형식을 2로 설정
set nokey
: 데이터 항목을 안보이도록 설정
plot 'a.txt' with boxes lc rgbcolor 'black'
: a.txt 파일을 읽어, 검은색 막대 그래프로 2차원 그래프를 그림
'Programming > Gnuplot' 카테고리의 다른 글
[GNUplot] csv 파일 읽을 때 x range 오류 (0) | 2019.07.18 |
---|