Gnuplot XRD图,连接点 [英] Gnuplot XRD graph, connecting points
问题描述
我有一个XRD数据,当我绘制它时,我想要这种图形.无论如何,excel在绘制太大的数据时遇到问题,我想用Gnuplot绘制它,这是我的代码
set title "GNUPLOT RESULT"
set xlabel "Wavelength 2Theta"
set ylabel "Intensity"
set xrange [20:90]
set key right center
set terminal pngcairo size 1600, 1000 enhanced font "Arial,16"
set output "Allt-XRD.png"
plot "AllW" using 1:2 w p pt 7 ps 2 lc rgb "orange" title "point", "AllW" using 1:2 smooth acspline lw 3 lc rgb 'blue' title 'spline'
但是它产生了什么,它不会连接所有点/点,我也不知道,但是在某种程度上,它具有连接它们的偏好(是否是权重点?).>
问题
- 如何使用Gnuplot连接excel图形中显示的所有点 预先感谢
P.S:我尝试了所有平滑版本的acscpline'cspline'bezier等.它不起作用
想知道为什么我不尝试的线条图
user8153的有效答案:使用十进制数据点而不是整数.样条曲线和点选项都可以完美绘制数据,如下所示
XRD数据看起来太长了,所以我只粘贴了其中的一些
Wavelength = 1.54059 Å (Cu)
Angle Intensity
20.00243 1467
20.02869 1533
20.05495 1482
20.08121 1468
20.10747 1376
20.13374 1421
20.16000 1433
20.18626 1380
20.21252 1431
20.23878 1405
20.26504 1357
20.29130 1374
20.31756 1413
您的with points
图显示您的数据仅包含波长的整数值,但是每个值都有多个与之相关的强度.这真的是数据的样子吗?还是在小数点后截断了波长值时出现了一些错误?也许您的数据文件使用了gnuplot无法识别的小数点符号?如果是这样,请使用set decimalsign
,以便gnuplot意识到您正在向其提供浮点数.
gnuplot确实按照您的指示进行操作:将所有这些点绘制在相同的x
坐标上,如果使用with lines
,则将它们与线连接起来,然后按垂直方向进行构造./p>
I have a XRD data and when I plot it I want to have this kind of graph. Anyway, excel has a problem to plot too large data and I want to plot it with Gnuplot and here is my code
set title "GNUPLOT RESULT"
set xlabel "Wavelength 2Theta"
set ylabel "Intensity"
set xrange [20:90]
set key right center
set terminal pngcairo size 1600, 1000 enhanced font "Arial,16"
set output "Allt-XRD.png"
plot "AllW" using 1:2 w p pt 7 ps 2 lc rgb "orange" title "point", "AllW" using 1:2 smooth acspline lw 3 lc rgb 'blue' title 'spline'
But what it produces, it does not connect all dots/points and I do not know but somehow it has a preferences (is it a weight point?) to connecting them.
Question
- How can I connect all the dots as seen at excel graph with Gnuplot Thanks in advance
P.S: I tried all bunch of smooth version acscpline' cspline' bezier etc. it did not work
Edit 1: The line plot who wonders why I do not try it
Edit 2: The worked answer of user8153 : Use decimal data point not an integer. Both spline and points option plot perfectly the data as it seen below
How XRD data looks like, it is too long so I pasted only a few of them
Wavelength = 1.54059 Å (Cu)
Angle Intensity
20.00243 1467
20.02869 1533
20.05495 1482
20.08121 1468
20.10747 1376
20.13374 1421
20.16000 1433
20.18626 1380
20.21252 1431
20.23878 1405
20.26504 1357
20.29130 1374
20.31756 1413
Your with points
plot shows that your data contains only integer values of the wavelength, but each value has multiple intensities associated with it. Is that really what the data should look like, or was there some mistake that chopped off the values of the wavelengths after the decimal point? Maybe your data file uses a symbol for the decimal point that gnuplot doesn't recognize? If so, use set decimalsign
so gnuplot realizes that you are feeding it floating point numbers.
As it is, gnuplot does precisely what you tell it to do: it plots all these points at the same x
coordinate, and connects them with lines if you use with lines
, which are then by construction vertical.
这篇关于Gnuplot XRD图,连接点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!