如何用新的点绘制新的图形?根欧洲核子研究中心
我想询问一下信息。 我正在学习ROOT。 我有 100 个文件,每个文件有 9 列。 我需要获取第一列的 x 数据以及每个其他 y 的相对值。 使用push_back方法我创建向量X和Y[8]。
现在为了对其进行标准化,我需要取 X 元素中的最小值并平移所有点,并制作一个包含所有平移点的图表。
我想问一下我哪里出错了。
M= 8 列 I = 100 个文件,有 9 列 - 1 列用于 X,8 列用于 Y - for (int i=0; i
int npoints = (int)X.size();
for (int k=0; k<M; k++) {
g[i][k]= new TGraph();
g[i][k]->SetNameTitle( Form("graphic_name_%d_%d",i,k), Form("graphic_name_ %d_%d",i,k) );
}
for (int p=0; p<M; p++) {
for( int b=0; b<npoints; b++){
float a=X[0];
double t;
t=b-a;
g[i][p]->SetPoint(b,X[t],Y[p][t]);
}
}
请帮助我吗? 谢谢
I wanted to ask for a information.
I am studying ROOT.
I have 100 files and each file has 9 columns.
I need to take the x data of the first column and for every other y the relative values.
using the push_back method i create the vectors X and Y[8].
Now to normalize it, I need to take the smallest value among the elements of X and translate all the points and make a graph with all the points translated.
I wanted to ask where I am going wrong.
M= 8 columns
I = 100 file with 9 columns-- 1 for X and 8 for Y — for (int i=0; i<N; i++){ etc…
int npoints = (int)X.size();
for (int k=0; k<M; k++) {
g[i][k]= new TGraph();
g[i][k]->SetNameTitle( Form("graphic_name_%d_%d",i,k), Form("graphic_name_ %d_%d",i,k) );
}
for (int p=0; p<M; p++) {
for( int b=0; b<npoints; b++){
float a=X[0];
double t;
t=b-a;
g[i][p]->SetPoint(b,X[t],Y[p][t]);
}
}
please,can you help me?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此代码片段可能会为您提供一些有关如何解决问题的想法:
This code snippet might give you some ideas on how to approach your problem: