注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

随机过程

http://superware.blog.163.com

 
 
 

日志

 
 

用GNUPLOT画电荷密度图  

2013-01-12 21:36:35|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
可以用如下 bash 脚本来画电荷密度图,

#!/bin/bash


cat > $1.gnu << EOF
set view map
set size square
unset surface
unset clabel
set contour
# set dgrid3d 100,141
set cntrparam cubicspline
set table

# Define here the countour values. Each set of countours will have the same
# color and is written in a different file

set cntrparam levels discrete 0.005
set output "table1.dat"
splot "$1" using 1:2:3 w l

set cntrparam levels discrete 0.01, 0.02, 0.03
set output "table2.dat"
splot "$1" using 1:2:3 w l

set cntrparam levels discrete 0.04,0.05,0.06
set output "table3.dat"
splot 'si.rho_new.dat' using 1:2:3 w l

set cntrparam levels discrete 0.07,0.08
set output "table4.dat"
splot "$1" using 1:2:3 w l

unset table

# Now define a postcript terminal

set encoding iso_8859_15
set terminal postscript enhanced solid color "Helvetica" 20
set output "$1.ps"

# prepare the countour graph

set size ratio 1./1.4142
set key off

alat = 10.2

set border lw 3
set label "Si" at 10.6,8.7
set xrange [0:1.4142136*alat]
set yrange [0:alat]
set xlabel "r (a.u.)"
set ylabel "r (a.u.)"

# Set contour labels

dato = "0.08"

set obj 9 rect at 6.,1.3 size char strlen(dato)*0.6, char 0.6
set obj 9 fillstyle solid noborder front
set label at 6.,1.3 dato front center font "Helvetica,12" tc rgb "blue"

dato = "0.07"

set obj 10 rect at 7.9,1.3 size char strlen(dato)*0.6, char 0.6
set obj 10 fillstyle solid noborder front
set label at 7.9,1.3 dato front center font "Helvetica,12" tc rgb "blue"

dato = "0.06"

set obj 11 rect at 3.3,1.0 size char strlen(dato)*0.6, char 0.6
set obj 11 fillstyle solid noborder front
set label at 3.3,1.0 dato front center font "Helvetica,12" tc rgb "green"

dato = "0.01"

set obj 12 rect at 3.6,6.0 size char strlen(dato)*0.6, char 0.6
set obj 12 fillstyle solid noborder front
set label at 3.6,6.0 dato front center font "Helvetica,12" tc rgb "red"

dato = "0.02"
set obj 13 rect at 3.6,5.4 size char strlen(dato)*0.6, char 0.6
set obj 13 fillstyle solid noborder front
set label at 3.6,5.4 dato front center font "Helvetica,12" tc rgb "red"

dato = "0.03"

set obj 14 rect at 3.6,4.9 size char strlen(dato)*0.6, char 0.6
set obj 14 fillstyle solid noborder front
set label at 3.6,4.9 dato front center font "Helvetica,12" tc rgb "red"

dato = "0.04"

set obj 15 rect at 2.3,3.7 size char strlen(dato)*0.6, char 0.6
set obj 15 fillstyle solid noborder front
set label at 2.3,3.7 dato front center font "Helvetica,12" tc rgb "green"

dato = "0.05"

set obj 16 rect at 3.6,3.7 size char strlen(dato)*0.6, char 0.6
set obj 16 fillstyle solid noborder front
set label at 3.6,3.7 dato front center font "Helvetica,12" tc rgb "green"

dato = "0.05"

set obj 17 rect at 7.2,1.9 size char strlen(dato)*0.6, char 0.6
set obj 17 fillstyle solid noborder front
set label at 7.2,1.9 dato front center font "Helvetica,12" tc rgb "green"

dato = "0.01"

set obj 18 rect at 10.8,2.3 size char strlen(dato)*0.6, char 0.6
set obj 18 fillstyle solid noborder front
set label at 10.8,2.3 dato front center font "Helvetica,12" tc rgb "red"

dato = "0.005"

set obj 18 rect at 10.8,6.8 size char strlen(dato)*0.6, char 0.6
set obj 18 fillstyle solid noborder front
set label at 10.8,6.8 dato front center font "Helvetica,12" tc rgb "dark-yellow"

# Print the countour

plot "table1.dat" u 1:2 w l lw 3 lc rgb "dark-yellow",\
"table2.dat" u 1:2 w l lw 3 lc rgb "red",\
"table3.dat" u 1:2 w l lw 3 lc rgb "green",\
"table4.dat" u 1:2 w l lw 3 lc rgb "blue"
EOF
echo -e " generating contour plot of the charge si.contour.ps...\c"
gnuplot < $1.gnu > $1.out
echo -e " done"


使用方法:

plotcharg.sh  charge.dat

举例:
plotchar.sh  si.charge_110.dat
得到:

用GNUPLOT画电荷密度图 - superware - 随机过程
感觉似乎还不错。
  评论这张
 
阅读(148)| 评论(0)
推荐

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018