유령 그래프좋아, 나는 이것을 당황스럽게했지만 논리적 인 결론을 찾지 못했다. 거기에있는 누군가가 내 요구를 해결하지 못한다고해도 나는 왜 내가 얻고있는 것을 얻고 있는지 설명 할 수있다.
dt = Open ();
col_list = dt << get column names(string);
remove from(col_list, 1); // Remove time[sec] from list
cols_to_plot = {};
offset_list = {};
offset_cols = {};
// Define the graph builder commands in an expression for use by the OK button
graph_expr = expr(
for (i = 1, i <= nitems(cols_to_plot), i++,
new_name = cols_to_plot[i] || "-Chemical Cal";
insertinto(offset_cols, new_name);
dt << new column(new_name, Numeric, "Continuous", Format( "Best", 12 ),
Formula( as column(dt, cols_to_plot[i]) * offset_list[i] ) );
);
// Now for the graph - build a text string and then execute it
gb_text = "\[gb = graph builder(
show control panel(0),
variables(
X( :Name( "Time[sec]" ) ),]\";
elements_txt = " ),
Elements( Line( X, ";
For( i = 1, i <= N Items( cols_to_plot ), i++,
If( i == 1,
// then
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ) ), ]\" )
,
// else
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ), Position( 1 ) ),]\" )
);
elements_txt = elements_txt || Eval Insert( "Y ( ^i^ ), " );
);
elements_txt = elements_txt ||
"Legend( 7 ) ),
Points( X, ";
For( i = 1, i <= N Items( cols_to_plot ), i++,
If( i == 1,
// then
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ) ), ]\" )
,
// else
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ), Position( 1 ) ),]\" )
);
elements_txt = elements_txt || Eval Insert( "Y ( ^i^ ), " );
);
elements_txt = elements_txt ||
"Legend(8)))";
gb_text = gb_text || elements_txt || "); ";
Eval( Parse( gb_text ) );
);
nw = new window("Graph Chemicals",
panel box("Select channels to graph",
lineup box(ncol(2),
text box("Column"), text box("Chemical Cal"),
cb1 = checkbox("Ch1"), ch1_neb = number edit box(),
cb2 = checkbox("Ch2"), ch2_neb = number edit box(),
cb3 = checkbox("Ch3"), ch3_neb = number edit box(),
cb4 = checkbox("Ch4"), ch4_neb = number edit box(),
cb5 = checkbox("Ch5"), ch5_neb = number edit box(),
cb6 = checkbox("Ch6"), ch6_neb = number edit box(),
cb7 = checkbox("Ch7"), ch7_neb = number edit box(),
cb8 = checkbox("Ch8"), ch8_neb = number edit box(),
cb9 = checkbox("Ch9"), ch9_neb = number edit box(),
),
),
panelbox("Actions",
hlistbox(
okb = button box("OK",
if (cb1 << get(1),
insertinto(cols_to_plot, col_list[8]);
offset_value = ch1_neb << get;
insertinto(offset_list, offset_value);
);
if (cb2 << get(1),
insertinto(cols_to_plot, col_list[9]);
offset_value = ch2_neb << get;
insertinto(offset_list, offset_value);
);
if (cb3 << get(1),
insertinto(cols_to_plot, col_list[10]);
offset_value = ch3_neb << get;
insertinto(offset_list, offset_value);
);
if (cb4 << get(1),
insertinto(cols_to_plot, col_list[11]);
offset_value = ch4_neb << get;
insertinto(offset_list, offset_value);
);
if (cb5 << get(1),
insertinto(cols_to_plot, col_list[12]);
offset_value = ch5_neb << get;
insertinto(offset_list, offset_value);
);
if (cb6 << get(1),
insertinto(cols_to_plot, col_list[13]);
offset_value = ch6_neb << get;
insertinto(offset_list, offset_value);
);
if (cb7 << get(1),
insertinto(cols_to_plot, col_list[14]);
offset_value = ch7_neb << get;
insertinto(offset_list, offset_value);
);
if (cb8 << get(1),
insertinto(cols_to_plot, col_list[15]);
offset_value = ch8_neb << get;
insertinto(offset_list, offset_value);
);
graph_expr;
nw << close window;
),
canb = button box("Cancel", nw << close window;
),
)
),
);
// Pre-check checkboxes if column exists
for (i = 1, i <= nitems(col_list), i++,
if (col_list[i] == "Ch1", cb1 << set(1, 1),
col_list[i] == "Ch2", cb2 << set(1, 1),
col_list[i] == "Ch3", cb3 << set(1, 1),
col_list[i] == "Ch4", cb4 << set(1, 1),
col_list[i] == "Ch5", cb5 << set(1, 1),
col_list[i] == "Ch6", cb6 << set(1, 1),
col_list[i] == "Ch7", cb7 << set(1, 1),
col_list[i] == "Ch8", cb8 << set(1, 1),
col_list[i] == "Ch9", cb9 << set(1, 1),
);
);스크립트는 이것입니다. 목표는 라인과 포인트를 모두 표시하는 단일 그래프를 작성하는 것입니다.이 그래프는이 스크립트에서 수행하는 (화학 보정 계수로 수정 된) 윈도우에서 선택한 열의 개수와 상관없이 사용할 수 있습니다. 포인트가있는 오류가있는 부드러운 그래프가 나타납니다. 설명을 찾을 수 없습니다. 변수 스크립트의 중복으로 인해 발생한다고 가정 할 수는 있지만이를 제거하거나 조정하여 원하는 결과를 얻는 방법을 모르겠습니다.

이것은 원하지 않는 그래프의 모양이며, 스크립트를 실행 한 후 스크립트가 그래프로 표시되어야하는 내용입니다.

나는 부드러운 스크립트가 어떻게 생성되는지를 설명하는 스크립트의 어느 부분도 찾을 수는 없지만 그곳에 있습니다. 성공하지 못한 그래프를 제거하거나 겹쳐 쓰는 지 알기 위해 부드러운 그래프의 세 번째 줄을 추가하려고 시도했으며, 다음 범례에 대한 정의도 스크립트에 없기 때문에 아무런 성공없이 작성하려고했습니다. 스크립트가 그것을 인식하지 못합니다.
어쨌든, 잘하면 누군가가 당신의 도움에 미리 감사드립니다 아이디어를 가지고 있습니다!
재 : 고스트 그래프dt = Open ();
col_list = dt << get column names(string);
remove from(col_list, 1); // Remove time[sec] from list
cols_to_plot = {};
offset_list = {};
offset_cols = {};
// Define the graph builder commands in an expression for use by the OK button
graph_expr = expr(
for (i = 1, i <= nitems(cols_to_plot), i++,
new_name = cols_to_plot[i] || "-Chemical Cal";
insertinto(offset_cols, new_name);
dt << new column(new_name, Numeric, "Continuous", Format( "Best", 12 ),
Formula( as column(dt, cols_to_plot[i]) * offset_list[i] ) );
);
// Now for the graph - build a text string and then execute it
gb_text = "\[gb = graph builder(
show control panel(0),
variables(
X( :Name( "Time[sec]" ) ),]\";
elements_txt = " ),
Elements( Line( X, ";
For( i = 1, i <= N Items( cols_to_plot ), i++,
If( i == 1,
// then
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ) ), ]\" )
,
// else
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ), Position( 1 ) ),]\" )
);
elements_txt = elements_txt || Eval Insert( "Y ( ^i^ ), " );
);
elements_txt = elements_txt ||
"Legend( 7 ) ),
Points( X, ";
For( i = 1, i <= N Items( cols_to_plot ), i++,
elements_txt = elements_txt || Eval Insert( "Y ( ^i^ ), " );
);
elements_txt = elements_txt ||
"Legend(8)))";
gb_text = gb_text || elements_txt || "); ";
Eval( Parse( gb_text ) );
);
nw = new window("Graph Chemicals",
panel box("Select channels to graph",
lineup box(ncol(2),
text box("Column"), text box("Chemical Cal"),
cb1 = checkbox("Ch1"), ch1_neb = number edit box(),
cb2 = checkbox("Ch2"), ch2_neb = number edit box(),
cb3 = checkbox("Ch3"), ch3_neb = number edit box(),
cb4 = checkbox("Ch4"), ch4_neb = number edit box(),
cb5 = checkbox("Ch5"), ch5_neb = number edit box(),
cb6 = checkbox("Ch6"), ch6_neb = number edit box(),
cb7 = checkbox("Ch7"), ch7_neb = number edit box(),
cb8 = checkbox("Ch8"), ch8_neb = number edit box(),
cb9 = checkbox("Ch9"), ch9_neb = number edit box(),
),
),
panelbox("Actions",
hlistbox(
okb = button box("OK",
if (cb1 << get(1),
insertinto(cols_to_plot, col_list[8]);
offset_value = ch1_neb << get;
insertinto(offset_list, offset_value);
);
if (cb2 << get(1),
insertinto(cols_to_plot, col_list[9]);
offset_value = ch2_neb << get;
insertinto(offset_list, offset_value);
);
if (cb3 << get(1),
insertinto(cols_to_plot, col_list[10]);
offset_value = ch3_neb << get;
insertinto(offset_list, offset_value);
);
if (cb4 << get(1),
insertinto(cols_to_plot, col_list[11]);
offset_value = ch4_neb << get;
insertinto(offset_list, offset_value);
);
if (cb5 << get(1),
insertinto(cols_to_plot, col_list[12]);
offset_value = ch5_neb << get;
insertinto(offset_list, offset_value);
);
if (cb6 << get(1),
insertinto(cols_to_plot, col_list[13]);
offset_value = ch6_neb << get;
insertinto(offset_list, offset_value);
);
if (cb7 << get(1),
insertinto(cols_to_plot, col_list[14]);
offset_value = ch7_neb << get;
insertinto(offset_list, offset_value);
);
if (cb8 << get(1),
insertinto(cols_to_plot, col_list[15]);
offset_value = ch8_neb << get;
insertinto(offset_list, offset_value);
);
graph_expr;
nw << close window;
),
canb = button box("Cancel", nw << close window;
),
)
),
);
// Pre-check checkboxes if column exists
for (i = 1, i <= nitems(col_list), i++,
if (col_list[i] == "Ch1", cb1 << set(1, 1),
col_list[i] == "Ch2", cb2 << set(1, 1),
col_list[i] == "Ch3", cb3 << set(1, 1),
col_list[i] == "Ch4", cb4 << set(1, 1),
col_list[i] == "Ch5", cb5 << set(1, 1),
col_list[i] == "Ch6", cb6 << set(1, 1),
col_list[i] == "Ch7", cb7 << set(1, 1),
col_list[i] == "Ch8", cb8 << set(1, 1),
col_list[i] == "Ch9", cb9 << set(1, 1),
);
);그것은 기적이지만 작동하지만 중복성과 관련이 있다는 것을 알았지 만 세그먼트를 제거하지 않고 세그먼트를 제거하는 방법을 찾지 못해 결국 알아 냈습니다! 이제는 도트 크기를 조정할 수만 있다면 XD 라인 만 있으면됩니다.
재 : 고스트 그래프Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :Name( "Time[sec]" ) ),
Y( :Name( "CH2-Chemical Cal" ) ),
Y( :Name( "CH5-Chemical Cal" ), Position( 1 ) ),
Y( :Name( "CH6-Chemical Cal" ), Position( 1 ) ),
Y( :Name( "CH5-Chemical Cal" ), Position( 1 ) ),
Y( :Name( "CH6-Chemical Cal" ), Position( 1 ) )
),
Elements(
Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 7 ) ),
Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 8 ) )
),
SendToReport( Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 0 )} ) )
);
흥미롭게도 오류 그래프를 제거한 후에 중복되는 첫 번째 채널은 하나의 Y 변수 만 가지며 다른 두 채널은 여전히 그렇지만 오류 그래프를 생성하지는 않습니다. 그래프의 목적은 피크 값을 쉽게 식별 할 수 있도록 그래프의 피크 세그먼트를 선택할 수있는 능력으로 필요한 많은 라인을 생성 할 수있게하는 것입니다. 원하는 라인을 표시하는 것이 가장 쉽기 때문에 라인 모양을 가지고 있습니다. 외관. 선은 선상의 점을 선택할 수 없으므로 점은 해당 기능에 필요하지만 시각적으로는 불필요합니다.
지체히해서 미안해, 추수 감사절 휴가가 길어서 네가 즐겁다는 희망이 든다. ^
재 : 고스트 그래프Damion,
원하는 그래프에 대한 그래프 빌더 코드로 게시물을 업데이트하십시오. 열을 작성 했으므로 포인트 앤 클릭 (GUI)을 사용하여 열을 작성하십시오.
귀하의 이메일에서 나는 이런 느낌을주고 싶어합니다.
Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :Name( "Time[sec]" ) ),
Y( :Name( "CH2" ) ),
Y( :Name( "CH2-Chemical Cal" ), Position(1) )
),
Elements(
Position( 1, 1 ),
Line( X, Y(1), Y(2) Legend( 7 ) ),
Points( X, Y(1), Y(2) Legend( 8 ) ) //maybe remove Y(2) from points?
),
);
이것은 두 개의 곡선을 오버레이합니다. 나는 단지 짐작하고있다?
재 : 고스트 그래프나는 그것이 문제의 일부라고 생각하지만, 만약 하나의 그래프로 정확히 동일한 스크립트를 실행한다면 (점이나 선이 중요하지 않든) 추가 그래프를 생성하지 않는다.
dt = Open ();
col_list = dt << get column names(string);
remove from(col_list, 1); // Remove time[sec] from list
cols_to_plot = {};
offset_list = {};
offset_cols = {};
// Define the graph builder commands in an expression for use by the OK button
graph_expr = expr(
for (i = 1, i <= nitems(cols_to_plot), i++,
new_name = cols_to_plot[i] || "-Chemical Cal";
insertinto(offset_cols, new_name);
dt << new column(new_name, Numeric, "Continuous", Format( "Best", 12 ),
Formula( as column(dt, cols_to_plot[i]) * offset_list[i] ) );
);
// Now for the graph - build a text string and then execute it
gb_text = "\[gb = graph builder(
show control panel(0),
variables(
X( :Name( "Time[sec]" ) ),]\";
elements_txt = " ),
Elements( Line( X, ";
For( i = 1, i <= N Items( cols_to_plot ), i++,
If( i == 1,
// then
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ) ), ]\" )
,
// else
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ), Position( 1 ) ),]\" )
);
elements_txt = elements_txt || Eval Insert( "Y ( ^i^ ), " );
);
// add in the marker and transparency code
elements_txt = elements_txt ||
"Legend( 7 ) ), Points( X, Y, Legend(8))),
SendToReport(
Dispatch(
{},
\!"400\!",
ScaleBox,
{Legend Model(
8,
Properties( 0, {Marker Size( 0 ), Transparency( 0 )}, Item ID( \!""
|| offset_cols[1] || "\!", 1 ) )
)}
)
)";
gb_text = gb_text || elements_txt || "); ";
Eval( Parse( gb_text ) );
);
nw = new window("Graph Chemicals",
panel box("Select channels to graph",
lineup box(ncol(2),
text box("Column"), text box("Chemical Cal"),
cb1 = checkbox("Ch1"), ch1_neb = number edit box(),
cb2 = checkbox("Ch2"), ch2_neb = number edit box(),
cb3 = checkbox("Ch3"), ch3_neb = number edit box(),
cb4 = checkbox("Ch4"), ch4_neb = number edit box(),
cb5 = checkbox("Ch5"), ch5_neb = number edit box(),
cb6 = checkbox("Ch6"), ch6_neb = number edit box(),
cb7 = checkbox("Ch7"), ch7_neb = number edit box(),
cb8 = checkbox("Ch8"), ch8_neb = number edit box(),
cb9 = checkbox("Ch9"), ch9_neb = number edit box(),
),
),
panelbox("Actions",
hlistbox(
okb = button box("OK",
if (cb1 << get(1),
insertinto(cols_to_plot, col_list[8]);
offset_value = ch1_neb << get;
insertinto(offset_list, offset_value);
);
if (cb2 << get(1),
insertinto(cols_to_plot, col_list[9]);
offset_value = ch2_neb << get;
insertinto(offset_list, offset_value);
);
if (cb3 << get(1),
insertinto(cols_to_plot, col_list[10]);
offset_value = ch3_neb << get;
insertinto(offset_list, offset_value);
);
if (cb4 << get(1),
insertinto(cols_to_plot, col_list[11]);
offset_value = ch4_neb << get;
insertinto(offset_list, offset_value);
);
if (cb5 << get(1),
insertinto(cols_to_plot, col_list[12]);
offset_value = ch5_neb << get;
insertinto(offset_list, offset_value);
);
if (cb6 << get(1),
insertinto(cols_to_plot, col_list[13]);
offset_value = ch6_neb << get;
insertinto(offset_list, offset_value);
);
if (cb7 << get(1),
insertinto(cols_to_plot, col_list[14]);
offset_value = ch7_neb << get;
insertinto(offset_list, offset_value);
);
if (cb8 << get(1),
insertinto(cols_to_plot, col_list[15]);
offset_value = ch8_neb << get;
insertinto(offset_list, offset_value);
);
graph_expr;
nw << close window;
),
canb = button box("Cancel", nw << close window;
),
)
),
);
// Pre-check checkboxes if column exists
for (i = 1, i <= nitems(col_list), i++,
if (col_list[i] == "Ch1", cb1 << set(1, 1),
col_list[i] == "Ch2", cb2 << set(1, 1),
col_list[i] == "Ch3", cb3 << set(1, 1),
col_list[i] == "Ch4", cb4 << set(1, 1),
col_list[i] == "Ch5", cb5 << set(1, 1),
col_list[i] == "Ch6", cb6 << set(1, 1),
col_list[i] == "Ch7", cb7 << set(1, 1),
col_list[i] == "Ch8", cb8 << set(1, 1),
col_list[i] == "Ch9", cb9 << set(1, 1),
);
);그리고 여분의 Y를 생성하지 않아야합니다. 그렇다면 그 중 하나만 생성되어야합니다.하지만 두 번째 그래프에 넣기 위해 if를 복제했기 때문에 그것이라고 생각합니다.이 유령을 만드는 중입니다. 나는 그 빌드에서 생성 된 스크립트를 볼 때 지원된다고 생각한다.
Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :Name( "Time[sec]" ) ),
Y( :Name( "CH2-Chemical Cal" ) ),
Y( :Name( "CH2-Chemical Cal" ) )
),
Elements(
Position( 1, 1 ),
Line( X, Y, Legend( 7 ) ),
Points( X, Y, Legend( 8 ) )
),
Elements(
Position( 1, 2 ),
Points( X, Y, Legend( 9 ) ),
Smoother( X, Y, Legend( 10 ) )
)
);
더 부드럽고 두 번째 그래프뿐만 아니라 두 번째 점 그래프가 더 매끄럽기 때문에
나는
|| 평가 삽입 ( "Y (^ i ^)," )
스크립트의 요소 이후부터 기본적으로 수직선으로 바뀌 었습니다 (여전히 매끄럽게 점을 찍었고 마술처럼 점을 찍었습니다)
재 : 고스트 그래프불필요한 이름에 대해 중복 된 코드 (추가 사본 붙여 넣기?)가있는 것으로 보입니다. 두 요소가 필요하지만 Y 이름은 한 번 필요합니다. 복제 된 이름은 Y (1)을 다시 그리는 것이며 기본값은 부드러운 요소입니다.
아래는 BigClass입니다. 다음 JSL은 스크립트의 중복 코드입니다.
Graph Builder(
Size( 528, 454 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Line( X, Y, Legend( 5 ) ) )
)
For( i = 1, i <= N Items( cols_to_plot ), i++,
If( i == 1,
// then
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ) ), ]\" )
,
// else
gb_text = gb_text || Eval Insert( "\!N\[ Y( :Name( "^offset_cols[i]^" ), Position( 1 ) ),]\" )
);
elements_txt = elements_txt || Eval Insert( "Y ( ^i^ ), " );
);