- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图在gnuplot中容纳一些数据。数据是不同的曲线。我有三个.gnp
文件:一个用于数学过程,一个用于调用要分析的文件,另一个必须在gnuplot中启动。
我得到的是这个错误,但我不知道如何解决。
gnuplot> load '0-one_fit.gnp'
gnuplot> id = $0
^
"0-one_fit.gnp" line 5: column() called from invalid context
id = $0
filename = sprintf("FeCoBSiNbCu%04d.chi",id)
fit [26:35.6] f110(x) filename u 1:2 via x110,A110,w110,a0,a1
fit [42.3:45.1] f200(x) filename u 1:2 via x200,A200,w200,b0,b1
fit [48:56.1] f23(x) filename u 1:2 via x2,A2,w2,x211,A211,w211,c0,c1
entry1 = sprintf("%d\t%.3f\t%.3f\t%.1f\t%.1f\t%.3f\t%.3f\t",id,x110,x110_err,A110,A110_err,w110,w110_err)
entry2 = sprintf("%.3f\t%.3f\t%.1f\t%.1f\t%.3f\t%.3f\t",x200,x200_err,A200,A200_err,w200,w200_err)
entry3 = sprintf("%.3f\t%.3f\t%.1f\t%.1f\t%.3f\t%.3f\t",x2,x2_err,A2,A2_err,w2,w2_err)
entry4 = sprintf("%.3f\t%.3f\t%.1f\t%.1f\t%.3f\t%.3f",x211,x211_err,A211,A211_err,w211,w211_err)
print entry1, entry2, entry3, entry4
id=ARG1
更改了文件,但是现在它给了我另一个错误
gnuplot> call '0-one_fit.gnp' 0
"0-one_fit.gnp" line 8: f_sprintf: attempt to print string value with numeric format
int(id)
更改,它说:
load '0-one_fit.gnp'
"0-one_fit.gnp" line 8: Non-numeric string found where a numeric expression was expected
0-in-situ.gnp
的文件,其中包含用于峰拟合的函数:
#### First peak: (110)
bg110(x) = a0 + a1*x
k110(x) = (x-x110)/w110
Gauss110(x) = A110*exp(-log(2)*k110(x)**2)
Cauchy110(x) = A110/(1 + k110(x)**2)
pV110(x) = alpha*Gauss110(x) + (1-alpha)*Cauchy110(x)
f110(x) = pV110(x) + bg110(x)
#### Second peak: (200)
bg200(x) = b0 + b1*x
k200(x) = (x-x200)/w200
Gauss200(x) = A200*exp(-log(2)*k200(x)**2)
Cauchy200(x) = A200/(1 + k200(x)**2)
pV200(x) = beta*Gauss200(x) + (1-beta)*Cauchy200(x)
f200(x) = pV200(x) + bg200(x)
#### Third peak & deconvolution (Q2 & 211):
bg(x) = c0 + c1*x
k2(x) = (x-x2)/w2
k211(x) = (x-x211)/w211
Gauss2(x) = A2*exp(-log(2)*k2(x)**2)
Cauchy2(x) = A2/(1 + k2(x)**2)
pV2(x) = gamma*Gauss2(x) + (1-gamma)*Cauchy2(x)
Gauss211(x) = A211*exp(-log(2)*k211(x)**2)
Cauchy211(x) = A211/(1 + k211(x)**2)
pV211(x) = delta*Gauss211(x) + (1-delta)*Cauchy211(x)
f23(x) = pV2(x) + pV211(x) + bg(x)
alpha = 0
beta = 0
gamma = 1
delta = 0
A110 = 15574
x110 = 31.1
w110 = 2.4
a0 = 1760
a1 = 6
A200 = 4153
x200 = 52.2
w200 = 3
b0 = 1500
b1 = 15
A2 = 1800
x2 = 51.6
w2 = 3
A211 = 1897
x211 = 76.6
w211 = 0.3
c0 = 1830
c1 = -2
#### Loop through all XRD patterns:
load "0-loop.gnp"
call "0-one_fit.gnp" 447
call "0-one_fit.gnp" 448
call "0-one_fit.gnp" 449
call "0-one_fit.gnp" 450
call "0-one_fit.gnp" 451
call "0-one_fit.gnp" 452
最佳答案
您可以在绘图命令中使用$0
或column(0)
或在绘图命令中使用的函数。在其他地方,我猜这是“无效的上下文”。
检查以下示例:
还要检查help using
,help column
和help pseudocolumns
。
reset session
$Data <<EOD
11 12 13 14 15
21 22 23 24 25
31 32 33 34 35
41 42 43 44 45
EOD
# id = $0 # does not work, invalid context
# id = column(0) # does not work, invalid context
id(n) = column(n) # within a function, works
plot $Data u 0:1 w lp # works
plot $Data u ($0):1 w lp # works
plot $Data u (column(0)):1 w lp # works
plot $Data u (id(0)):1 w lp # works
call
(而不是
load
)。
call '0-one_fit.gnp' 123
0-one_fit.gnp
中,您可以通过
id = ARG1
访问此值。
id=$0
。
help call
和
help call old-style
(gnuplot 5.2)
关于compiler-errors - Gnuplot : fitting different curves,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58199317/
我知道这类问题已经得到解答,但就我而言,我已经尝试了所有配置,但仍然不起作用。我需要对我的配置有一个新的看法(我确信我错过了一些东西)。两个附加程序都会记录所有级别 我想将所有包的信息 >= 记录到控
我正在对 Windows 移动设备上的代码性能进行一些基准测试,并注意到某些算法在某些主机上的表现明显更好,而在其他主机上则明显更差。当然,考虑到时钟速度的差异。 供引用的统计数据(所有结果均由同一个
我有一个程序可以计算多边形的面积和周长。程序还会确认面积和周长的计算结果是否与预期结果相同。 我不明白发生了什么,但确认面积和周长是否与预期相同的验证部分无法正常工作。 例如,我现在测试并在所有情况下
Codepen :(对于那些想直接进入的人来说,这是一个代码笔。在 Chrome 和 IE 中尝试一下,看看结果的不同) 我正在尝试使用 css3 转换/过渡,因为它们比 jquery 效果更流畅。
我有几个不同的正则表达式要在给定文本中匹配和替换。 regex1 :如果文本包含单词“Founder”,则将所有文本替换为首席执行官 正则表达式2:如果文本包含9位数字,则将其替换为NUM 我尝试使用
我编写了多线程应用程序,它从每个线程的数据库连接到一些电子邮件帐户。我知道 JavaMail 没有任何选项可以使用 SOCKS5 进行连接,因此我决定通过 System.setProperty 方法使
如您所见,这是我当前 Storyboard的不同设备预览。底部的透明绿色被另一个 View Controller 占用,但需要为每个不同的尺寸类固定间距。我尝试将 Storyboard 中的宽度和高度
我正在创建一个游戏,我需要能够改变玩家 Sprite 的速度。我认为最好的选择是通过重力影响 Sprite 。为了给用户运动的感觉,我希望背景以完全相同的速度向相反的方向移动。 我怎样才能给背景一个不
我正在查看BTrees库并注意到有多个 TreeSet (和其他)类,例如 BTrees.IOBTree.TreeSet BTrees.OOBTree.TreeSet BTrees.LFBTree.T
我有一个小型 C++ 库,必须为 armeabi 和 armeabi7a 编译。我还有一个非常大的 c++ 库,只需要为 armeabi 编译。现在正在为两种架构编译它们(使用 NDK),但这使我的
我需要根据站点的当前部分稍微更改主题。 似乎 MuiThemeProvider 只在加载时设置 muiTheme;但需要在 props 变化时更新。 如何做到这一点? 最佳答案 您可以尝试将主题放在包
如何创建两个每个都有自己的计数器的 lSTListing 环境? 如果我使用例如 \lstnewenvironment{algorithm}[2]{ \renewcommand\lstlist
我想使用 Travis-CI 和 Github 基于分支设置部署。 IE。 - 如果我们从 develop 构建- 然后执行 /deploy.rb使用 DEV 环境主机名,如果 master - 然后
我有一个带有数据验证的 WPF MVVM 数据表单窗口。很多控件都是文本框。目前,数据绑定(bind)触发器设置为默认值,即。 e.失去焦点。这意味着仅在可能完全填写字段时才对其进行验证。所以当删除一
我有许多应用程序的内容页面,并最终为每个内容页面编写了很多 View 模型。例如。如果我有一个包含项目组的列表,我将有一个 ShowAllViewModel并绑定(bind)到内容页面和列表中单个项目
我有一个通用 View 和 4 个其他 View 。我在通用 View 中使用 Bootstrap 选项卡(导航选项卡)。我希望其他 4 个 View 成为通用 View 中 4 个选项卡的内容。由于
我希望针对 Maven 发布插件的不同目标有不同的配置选项。故事是这样的: 我正在将 Git 用于 SCM。我希望release:prepare插件在本地完成所有操作,并让release:perfor
我正在为一个项目使用AbstractTableModel制作一个自定义TableModel,并且我需要找到一种方法让复选框显示在某些行上,而不是其他行上。我已经实现了 getColumn 方法,但我希
摘自《Javascript 忍者的 secret 》一书: EVENTS ARE ASYNCHRONOUS Events, when they happen, can occur at unpredi
我正在尝试配置我的第一个 GWT 记录器,到目前为止,我已经将日志消息打印到我的 JS 控制台(FF 的 Firebug): 最终,我希望非SEVERE 消息转到consoleHa
我是一名优秀的程序员,十分优秀!