:D 获取中...

1 Gnuplot

1.1 example for fit

datafile="En-R_arm.dat"
outfile='fit_log_arm.dat'
##################################
set fit logfile outfile
set print outfile append
mean(x)=m       ## 拟合后m即为Y的平均值
fit [x=0.325:0.345] mean(x) datafile using (4*3.1415926*3.1415926/$2**2):1 via m  #range 可选
SST = FIT_WSSR  ## 对平均值的方差, 即SST

f(x)=a*x+b     ## 线性模型
FIT_LIMIT = 1e-6 
fit [x=0.325:0.345] f(x) datafile using (4*3.1415926*3.1415926/$2**2):1 via a,b 
SSE=FIT_WSSR    ## 对线性模型的方差, 即SSE
print "R^2=", 1-SSE/SST 
print "==========================================================="  

another example with loop:

datafile="En-R_arm.dat"
outfile='fit_arm.dat'
##################################
set fit logfile outfile
set print outfile append
do for [i=0:2]{
colx=i*3+2
coly=i*3+1
mean(x)=m       ## 拟合后m即为Y的平均值
fit mean(x) datafile using (4*3.1415926*3.1415926/(column(colx))**2):(column(coly)) via m
SST = FIT_WSSR  ## 对平均值的方差, 即SST

f(x)=a*x+b     ## 线性模型
FIT_LIMIT = 1e-6 
fit f(x) datafile using (4*3.1415926*3.1415926/(column(colx))**2):(column(coly)) via a,b 
SSE=FIT_WSSR    ## 对线性模型的方差, 即SSE

print "cols ".colx.":".coly." R^2=", 1-SSE/SST   
print "==========================================================="
}

1.2 example for band plot:

set data style dots
set key outside box
#set border 5
set font "Arial, 40"
set terminal png small  size 600,480
set output "C2_eig_band_-2.2254.png"
set arrow from 0.000000,0.0 to 4.01581339,0.0 nohead
set xrange [0: 4.01581339]
set yrange [-6.0 : 4.0 ]
unset xlabel ## "High symmetry K-points"
set ylabel "Energy (eV)"
unset key
set arrow from  1.46988978, -6.0  to  1.46988978 ,  4.0 nohead
set arrow from  2.31853117, -6.0  to  2.31853117 ,  4.0 nohead
set xtics (   " G " 0.0 ,  " M " 1.46988978 ,  " K " 2.31853117 ,  " G " 4.01581339 )
plot "C2_eig_band_-2.2254.dat" using 1:2 title "Bands"  with  lines linetype 3  linewidth 2

1.3 example for Dos plot:

#set data style dots
### alpha {/Symbol a} or {$\alpha$} maybe
### angstrom set encoding iso_8859_1 and use {/305}
set term postscript eps color enhanced size  24cm,24cm
set output "sp_dos.eps"
set xrange [-6: 4]
set xtics  2 out nomirror font "Arial, 18"
set mxtics 2
set xlabel "Energy (eV)" font "Arial, 20"
set ylabel "DOS (arb. units)"  font "Arial, 20"
set yrange [0 : 100 ]
set arrow from 0.0,0.0 to 0.0,100.0 nohead linestyle 0 linewidth 2
set ytics  20 out nomirror font "Arial, 18"
set mxtics 2
set  size 0.98,1.0
set lmargin 10; set rmargin 0
set key box opaque width 5 height 2 right top ### right top or at 0.5,1.0
set label "(a)" at -5.5,80  font "Arial, 25"
plot "dos_0.1_ef-2.9596_all.dat" using 1:2 title "{/Arial=20 Total}"  with  lines linetype 3  linewidth 2, \
"dos_0.1_ef-2.9596_all.dat" using 1:13 title "{/Arial=20 p}}"  with  lines linetype 1  linewidth 2

1.4 example for Dirac Cone plot

set border lw 10 ### border width 
set grid  ### grids in xy plane 
set view 85,45 ### view angle 
set xyplane at -0.45 ### xy plane at z=-0.15
set xrange [-0.03000000 : 0.03000000]
set yrange [0.30588000 : 0.36588000]
set zrange [-0.45:-0.2]
set xlabel "k_x"  font "Arial, 150" offset 35,-14  ### offset: label away from axis,need modification 
set ylabel "k_y"   font "Arial, 150" offset 0,-14 ### offset:need modification
set zlabel "Energy (eV)"  font "Arial, 120"  rotate by 90 center offset -40,0
set xtics 0.02 out  scale 8 font "Arial, 120" offset 0,-8  ### tics on axis 
set ytics 0.02 out  scale 8 font "Arial,  120" offset 0,-8
set ztics 0.1 out  scale 2  font "Arial,  120" 
set mytics 2  ### minor parts between major tics 
set mxtics 2
set mztics 2
set  size 1.0,1.0
set lmargin 40; set rmargin 0
unset key    ### not title 
#set ticslevel 0  #
set dgrid3d 100,100 splines #number of grid mesh in the X- and Y-directions
##  pm3d  to draw a color-mapped 3D figure
set hidden3d  ### hidden map behind 
set contour surface
set cntrparam level incremental -0.45,0.025,-0.21
set cbrange [-0.45:-0.21]
#set colorbox vertical user origin 0.17, 0.49 size 0.04,0.12
unset colorbox ### do not show color box bar 
set terminal png enhanced size 2723.4,2723.4  ## 80mm= 302.36 pixel
set output "Dirac_cone_dc.png"
splot "eig_bandsurf_022.dat" using 1:2:4 with pm3d , "eig_bandsurf_021.dat" using 1:2:4 with pm3d 
#pause -1
#### /Times-Italic not support pngcairo, pdfcairo, epspairo  {/Times-Italic=20  p}
set output  ### exit plot
##set term wxt  ### return windows 

2 Inkscape

2.1 Launch Speed

  • 编辑 >首选项–>界面:清楚列表并设置打开最近文档最大文件数为0.
  • 编辑 >首选项–>输入输出–>渲染:缓存设置512MiB,并且Gaussian模糊质量和滤镜效果都设置成最差.

2.2 Latex in Inkscape

  • Install pstoedit to D:\Datas\Softs\DraftTools\dosbin\pstoedit
  • 为Inkscape增加环境变量 in Autohotkey:EnvSet, Path, %DosHome%\pstoedit;C:\"Program Files"\"MiKTeX 2.9"\miktex\bin\x64

2.3 ShortCuts

  • 放大缩小:-/+/ctrl+滚轮/滚轮/shift+滚轮 放大/缩小画布, 上下/左右移动.
  • 撤销/重做:ctrl+z/ctrl+shift+z 撤销/重做.
  • 调节大小和旋转:工具条点击选取箭头, 点击目标一次, 可以缩放(加ctrl可以保持纵横比), 再点击一次, 可以变形/旋转(加ctrl可以控制15°间隔).
  • 三角形:1.扩展->渲染-> 三角形; 2. 先建一个方框, 路径->对象转化成路径, 编辑节点(F2),选中三个节点, 然后从已选节点断开路径.
  • 多边形:工具条选取形状, 如方框(F4, 加ctrl控制宽高比例),圆形(F5, 加ctrl控制宽高比例),多边形(*),螺旋形(F9). 方框圆角:选中方框, 编辑节点(F2), 拖动角上节点.
  • 多边形并补:选中多个多边形, 路径->并集: ctrl++; 差集:ctrl+-; 交集:ctrl+*;互斥: ctrl+^; 分割: ctrl+/.
  • 取色和填充:工具条, 图像拾取颜色(F7),填充封闭区域(shift+F7). 颜色调节:包括填充色、轮廓色和轮廓样式可调.
  • 直线曲线:工具条, 创建流程图连接器(ctrl+F2)可用来创建直线、箭头, 然后用通过节点编辑(F2)可使直线变为曲线.
  • 改变层z高度:选区升高/降低一步-pgup/pgdown, 顶层/底层-Home/End.
  • 多层选取:鼠标点击选中, alt+click选取下一层, 移动需加alt键.
  • 文本输入:工具条选取文字对象(F8).
  • 群组:选取->右键群组(ctrl+g).
  • 图片裁剪:在图片上方放一个方框, 然后
  • 颜色反转:滤镜–>颜色–>反转: 反转通道(默认无)/反转色调/反转亮度/反转透明度, 可能需调整光照透明度.
  • 位图轮廓:路径–>临摹位图轮廓(shift+alt+B):调节亮度截断阈值, 可选反相图像/平滑/堆叠扫描数/删除背景, 调整后更新调试, 选后后确定,将中心透明图拖出.
  • 半透明:滤镜–>填充和透明度–>亮度橡皮擦,扩张:351.6;侵蚀:362.6;全局不透明度0.72.

2.4 Bubble

http://www.ryanlerch.org/blog/simple-bubble-in-inkscape-orb-ball-bubble/

  1. 画一个圆圈,填充色无,笔刷颜色RGBA 4fbbffff,笔刷宽度选10mm.并将笔刷的模糊blur调为3.7
  2. 在圆的上半部画一个椭圆,二者上端对齐。椭圆从上到下渐变色4fbbffff到透明。
  3. 将圆圈复制,将其blur调为0,并于原圆圈对齐,全选三者,对象->剪切->设置。

2.5 Greek Symbols

  • 切换到中文输入法,输入alpha、beta、gamma等会弹出相应符号。

3 ImageMagick

3.1 视频倒放

3.1.1 视频倒放,无音频

ffmpeg.exe -i inputfile.mp4 -s 800x800 -filter_complex [0:v]reverse[v] -map [v] -preset superfast reversed.mp4

3.1.2 视频倒放,音频不变

ffmpeg.exe -i inputfile.mp4 -s 800x800 -vf reverse reversed.mp4

3.1.3 音频倒放,视频不变

ffmpeg.exe -i inputfile.mp4 -s 800x800 -map 0 -c:v copy -af “areverse” reversed_audio.mp4

3.1.4 音视频同时倒放

ffmpeg.exe -i inputfile.mp4 -s 800x800 -vf reverse -af areverse -preset superfast reversed.mp4

3.2 图片转视频

4 Veusz

4.1 Default Styles

  1. Edit–>Default Styles,设置好,Save到某个位置。
  2. Edit–>Preference–>New documents–>Stylesheet,设置到需要的默认格式位置。
    Ps: 各种图表,越靠上位置越靠外不被覆盖。

4.2 Date Import

点击“Import data to Veusz”按钮, 弹出以下对话框, 选Standard.

  • Filename处给出数据文件的位置
  • Dataset name处给出各类数据的名称, 与Origin等不同, Veusz不是把数据以表格形式导入, 而是转换成各一维数组, 所以这个名称是一维数组的名称, 是必须的. 当使用x,,y,z时跳过第二列.
  • Ignore text lines一般要选, 因为若是不选此项且数据文件有文字时, 数据导入不是数值格式, 而是文本格式.
  • Read data in blocks一般不选. 若是类似能带图那种多条曲线数据且以空行分割, 选此项会导入多对一维数组, 各条曲线分开, 数组太多. 画能带图时一般不选项, 将各列数据以nan(代替空行)分割, 以免多条曲线头尾相连.
  • Link dataset to files选择此项时, 数据不储存在Veusz文件内, 而是动态连接到外部数据文件. 可以使用unlink将数据储存在Veusz的文件中.
  • Prefix一般要写, 便于区分一维数组命名.
  • Tag一般也要写, 可以写数据文件名, 区分数据大类.
    导入后.

4.3 Plot

转到Editing面板,

  • 选中graph1(可以改名字), 下面有x、y两条轴, 可以通过Properties和Formatting两个面板修改两轴的显示. 在工具栏上选择add xy, 在graph1下级出现xy1项.
  • 选中xy1, 点击Properties面板, X data 选data-Energy, Y data选data-band_1,曲线出现, 然后修改x, y,xy1的Properties和Formatting.
  • 点击 Base Graphe 增加Graph.

4.4 Export

选择export按钮, 导出各种格式,一般png/tiff分辨率选600dpi,eps选300dpi.

4.5 Double Y axis

  1. 点击add axis按钮, 改其名字为y2,
  • Direction选择Vertical, Axis position选择1(右y轴).
  • 选择绘图xy2时, 将其Properties中的Y axis选为y2即可.
  1. 点击add axis按钮, 改其名字为x2, 调整位置,可以一页双图甚至多图。

4.6 Multigrid

选择Arrange Graphes in a gird, ,再在其下面新建add graph , 下面的与前面类似. 也可以将建好的graph拖入到grid下面.

4.7 2D Map

4.7.1 步骤

  1. 生成n\times m 的二维矩阵csv文件
  2. Veusz⇒Date⇒Import⇒2D: csv mode, set x/y range, give dataset name (e.g., 2Dmap) ⇒Import
  3. Press image button: Plot a 2d dataset as an image: dataset: 2Dmap, select colormap
  • P.S. use a common txt to build 2D dataset: Date⇒Create 2D: Name (e.g., 2Dmap), from x,y and z values based on 1D datasets or expressions, and select x,y and z datasets

4.8 Other Tips

  • Data–>Operations, 可以实现数据相加/减,乘以常数等操作。

5 Other Tools

5.1 Convert

5.1.1 png ⇒tiff

  • 在Windows下,直接使用画图程序转换分辨率较低,使用照片程序转换得到的tiff分辨率会较高。