Gnuplot学习笔记
Gnuplot学习笔记
Gnuplot学习笔记
安装
gnuplot-x11(可输出至X11)
帮助
$gnuplot
gnuplot>help some_command
示例
#输出
set term postscript eps enhanced size 3.7,5 #enhanced使用增强文本,size 图的大小(英寸),terminal默认为wxt(X11)
set output "psr.eps" #输出文件名
#坐标轴
set xlabel "Period (s)" #x轴label
set logscale x #设x轴为对数坐标
set xtics 1e-9,-1000,1e-24 #x轴标度范围
#set xtics (2,4,6,8,10)
set xr [0.001:20] #x轴范围
set ydata time #设y轴数据为时间
set timefmt "%H:%M:%S" #设置时间格式
set format y "%g{/Symbol \260}" #y轴标度格式
#标注
set key 0.01,100 #legend位置
#unset key #取消legend
set arrow from 0.1,2 to 0.2,3 #箭头
set label "peak" at 0.01,10 rotate by 10 #标签
#变量
a=3*2**3
#作图
plot "a.dat" using 1:2 title 'relation' with points pointtype 6 linetype rgb "red" pointsize 1,\ #数据文件作图
x**2 with line linetype 5 #函数做图
文件转换
eps->pdf(否则直接插入tex中enhance文本会显示异常)
epstopdf *.eps
pdflatex *.pdf
增强文本
运算符
^ a^x 上标 \superscript
_ a_x 下标 \subscript
@ a@^b_c 上标和下标同时出现 \phantom box (occupies no width)
& &{space} 插入指定宽度空白 \inserts space of specified length
~ ~a{0.8-} 将后字符放在前字符的顶部 \overprints '-' on 'a', raised by 0.8 times the current fontsize
评论暂时关闭