使用不同的腳本匯出多個圖表嘿 Jmp 用戶,
我正在嘗試在 Jmp 中匯出多個圖表。無論如何,有沒有選擇相應的腳本並將所有圖表一起匯出。
多謝 !
I
自動化和腳本編寫大規模客製化回复:使用不同的腳本導出多個圖形PMROZ,
嘗試打開“圖表”時,我仍然看到一個空白窗口。 我需要包括一些基本的東西嗎? 我的目標是將所有三個圖(Graphs、Graphs2 和 Graphs3)放在一個窗口中,這樣我就可以復制並粘貼到 Powerpoint 中。
非常感謝任何輸入。
尼爾
回复:使用不同的腳本導出多個圖形PMROZ,
非常感謝您的輸入! 作為新手,我仍在習慣 JSL 流程和功能,很高興獲得專家指導。 我包括了整個腳本(精簡),以向您展示整體流程。 根據以前考慮主宏和子例程的編碼經驗,我試圖將例程封裝在表達式中,以便稍後在程序中調用它們(“Files()”、“Join_files”和“Con”)。
我將“Graphs = Eval Expr”更改為“Graphs = Expr”,一切正常。 我不確定這是否需要 Eval,因為它是在另一個表達式 (Join_files) 中調用的。
我在新窗口中使用了圖表,但仍然得到一個空窗口。
再次感謝您的寶貴時間。
尼爾
Files = Expr(
SD1 = "C:\Users\";
path = {};
f1 = Files In Directory( SD1, recursive(1));
For( i = 1, i <= N Items( f1 ), i++,
If(Ends With( f1[i], ".csv" ),
f1[i] = Convert File Path(SD1) || f1[i];
b= f1[i];
Insert Into(path, b)
);
);
);
Join_files = Expr(
For( i = 1, i <= N Items( path ), i+=2,
/*area, %area, and pore pixel count*/
jointable1 = Open( path[i] );
//jointable1 << Get Name;
samplename = Substr( jointable1 << Get Name, 1, 18 ); //sample replicate name //
samplename2 = Word(1,q, "_"); // only sample name, no replicate suffix
jointable1 << New Column( "Sample",
Character,
Nominal,
Set Each Value( samplename ) // setting each row in column 1 to samp rep name //
);
jointable2 = Open( path[i + 1] );
dt = Data Table( jointable1 ) << Join(
With( Data Table( jointable2 ) ),
Select( :Sample, :Area, :Name( "%Area" ),:scale,:thick),
SelectWith( :pixD1, :count1),
Cartesian Join
);
Close( jointable1, no save );
Close( jointable2, no save );
Columns();
Graphs();
Graphs2();
Graphs3();
dt << Set Name(samplename);
po = dt << get name;
dt << Save(SD1 || po);
);
nw = new window("Example Export Multiple Platforms",
chart_output = vlistbox(
graphs,
);
);
);
Columns = Eval Expr(
dt << New Column( "Sample 2",
Character,
"Nominal",
Set Each Value(samplename2),
Set Display Width( 150 ),
);
);
Graphs = Eval Expr(
/*set graphs*/
dt << New Table Property( "Cumulative Resistivity",
Graph Builder(
Size( 591, 496 ),
Show Control Panel( 0 ),
Grid Color( "Black" ),
Graph Spacing( 2 ),
Variables(
X( :Name( "Diameter (um)" ) ),
Y( :Name( "flow resistivity (Pa*s/m^2)") ),
Overlay( :Sample )
),
Elements( Position( 1, 1 ), Line( X, Y, Legend( 20 ) ) ),
SendToReport(
Dispatch(
{},
"Diameter (um)",
ScaleBox,
{Min( 0 ), Max( 80 ), Inc( 1 ), Minor Ticks( 1 ),
Label Row(
{Show Major Grid( 1 ), Show Minor Grid( 1 )}
)}
),
Dispatch(
{},
"flow resistivity (Pa*s/m^2)",
ScaleBox,
{Scale( "Log" ), Format( "Scientific", 12 ), Min( 100000 ),
Max( 10000000000000 ), Inc( 1 ), Minor Ticks( 1 ),
Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
),
)
)
)
);
Con = Expr(
dt = {};
// Sort list ascending (sample replicates) //
For( i = 1, i <= N Table(), i++,
table = data table(i);
insert into(dt, table);
sort list into(dt)
);
// Concatenate each file (sample replicates) //
dt_all= Data Table( dt[1] ) << Concatenate(
Data Table( dt[2] ),
Data Table( dt[3] ),
Output Table( "Concatenated Table" )
);
// Rename file to sample name and Save //
dt_all << set name(samplename2);
dt_all:Sample << Set Display Width( 150 ); // Widen to include entire title
p = dt_all << get name;
dt_all << Save(SD1 || p);
close(dt_all, no save);
close(dt[1], no save);
close(dt[2], no save);
close(dt[3], no save);
);
Files();
Join_files();
Con();
回复:使用不同的腳本導出多個圖形嗨 NRW - 我認為你把事情複雜化了。您不需要將連接邏輯放入表達式中。只需在沒有周圍的 expr() 的情況下運行它。
這圖表邏輯在你的帖子中被切斷了,但我會這樣做表達式() , 而不是評估表達式() .
最後在你的新窗口中放
graphs,
並不是
graphs("Cumulative Resistivity"),
回复:使用不同的腳本導出多個圖形伙計們,
我只是偶然發現了這個線程,我想這就是我一直在追求的。 但是,我仍在努力克服 JSL 學習障礙,但我無法完全得到結果。
快速總結:
- 將 CSV 數據集合併到一張 JMP 表中
- 創建繪圖腳本並將其保存到數據表
- 稍後打開表格時,我運行三個繪圖腳本,然後將每個繪圖複製並粘貼到一張 Powerpoint 幻燈片中(與繪圖對應的圖像已經粘貼在同一張幻燈片中)
我希望通過至少將所有三個圖形匯集在一起並以可以同時導出所有三個圖形的格式來最大程度地減少單擊和復制步驟。 我一直在探索這是否需要使用儀表板或日誌來完成,它們以某種方式分組並保存為我可以拉過來的文件。 聖杯是將我的 jpg 圖像與我的 JMP 圖配對,然後帶到 PP。
我試過 Vlist 命令但是得到一個空窗口在嘗試獲取保存為腳本的情節時。 顯示了部分相關腳本片段。
歡迎任何想法或意見。
尼爾
Join_files = Expr(
For( i = 1, i <= N Items( path ), i+=2,
/*area, %area, and pore pixel count*/
jointable1 = Open( path[i] );
//jointable1 << Get Name;
samplename = Substr( jointable1 << Get Name, 1, 18 ); //sample replicate name //
samplename2 = Word(1,q, "_"); // only sample name, no replicate suffix
jointable1 << New Column( "Sample",
Character,
Nominal,
Set Each Value( samplename ) // setting each row in column 1 to samp rep name //
);
/*diameter and pore pixel count*/
jointable2 = Open( path[i + 1] );
dt = Data Table( jointable1 ) << Join(
With( Data Table( jointable2 ) ),
Select( :Sample, :Area, :Name( "%Area" ),:scale,:thick),
SelectWith( :pixD1, :count1),
Cartesian Join
);
Close( jointable1, no save );<SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="report summ_.JPG" style="width: 829px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="report summ_.JPG" style="width: 829px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="report summ_.JPG" style="width: 829px;"><span class="lia-inline-image-display-wrapper" image-alt="report summ_.JPG" style="width: 829px;"><img src="https://us.v-cdn.net/6038925/uploads/images/32980i018D050D35ACCDD9/report%20summ_.JPG" role="button" title="report summ_.JPG" alt="report summ_.JPG" /></span></SPAN></SPAN></SPAN>
Close( jointable2, no save );
Columns();
Graphs();
Graphs2();
Graphs3();
dt << Set Name(samplename);
po = dt << get name;
dt << Save(SD1 || po);
);
<BR />Graphs = Eval Expr(<BR />/*set graphs*/<BR />dt << New Table Property( "Cumulative Resistivity",<BR />Graph Builder(<BR />Size( 591, 496 ),<BR />Show Control Panel( 0 ),<BR />Grid Color( "Black" ),<BR />Graph Spacing( 2 ),<BR />Variables(<BR />X( :Name( "Pore Diameter (um)" ) ),<BR />Y( :Name( "Cumulative flow resistivity (Pa*s/m^2)") ),<BR />Y( :Pore Size Dist ),<BR />Y( :Name( "Cumulative Pore fraction (pore+solid)" ) ),<BR />Overlay( :Sample )<BR />),<BR />Elements( Position( 1, 1 ), Line( X, Y, Legend( 20 ) ) ),<BR />Elements( Position( 1, 2 ), Line( X, Y, Legend( 18 ) ) ),<BR />Elements( Position( 1, 3 ), Line( X, Y, Legend( 19 ) ) ),<BR />SendToReport(<BR />Dispatch(<BR />...<BR />
nw = new window("Example Export Multiple Platforms",
chart_output = vlistbox(
graphs("Cumulative Resistivity"),
);
);
);
回复:使用不同的腳本導出多個圖形你好@JMP發現者,
我想出了一個類似的解決方案@pmroz ,我喜歡他們所做的。
這是我的想法,但不如製作word文檔等好。您也可以將它們直接保存為PPT文件。 我在 JSL 中創建報告只是為了讓它們方便使用,但是如果您已經打開它們,for 循環也可以工作。 但是,如果您編寫一個生成報告的腳本,您可以只通過變量名引用報告而不是查找窗口列表。
Names Default To Here( 1 );
dt = open("$sample_data\Big Class.jmp");
rpt1 = dt << Bivariate( Y( :weight ), X( :height ) );
rpt2 = dt << Oneway( Y( :height ), X( :age ), X Axis Proportional( 0 ) );
rpt3 = dt << Fit Group(
Oneway( Y( :weight ), X( :age ), X Axis Proportional( 0 ) ),
Bivariate( Y( :weight ), X( :height ) ),
<<{Arrange in Rows( 2 )}
);
reportlist = {};
For( i = 0, i <= N Items( Window() ), i++,
If(
!Is Missing( Regex( Window( i ) << getwindow title, "Fit" ) ) == 1 | !Is Missing(
Regex( Window( i ) << getwindow title, "Oneway" )
) == 1 | !Is Missing( Regex( Window( i ) << getwindow title, "Bivariate" ) ) == 1,
Insert Into( reportlist, Window( i ) << get window title )
)
);
For( i = 1, i <= N Items( reportlist ), i++,
picbox = Window( reportlist[i] ) << getPicture;
picbox << SaveImage(
"whatever your local directory to save is\pic" || Char( i ) || ".png"
);
);這些應該讓你在路上工作得很好。
祝你好運!,
DS
回复:使用不同的腳本導出多個圖形下面是一個將三個圖形輸出從 Big Class 導出到 word 文檔的示例。
dt = open("$sample_data\Big Class.jmp");
dist = expr(dt << Distribution(
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) )
));
gb1 = expr(dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :age ), Y( :sex ) ),
Elements( Heatmap( X, Y, Legend( 2 ) ) )
));
gb2 = expr(dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
));
nw = new window("Example Export Multiple Platforms",
chart_output = vlistbox(
dist,
page break box(),
gb1,
page break box(),
gb2
);
);
chart_output << save msword("c:\temp\SampleCharts.doc", Native);