取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
选择语言 隐藏翻译栏
查看原发布的话题

3D散布図スクリプトから回転とデータ列を選択する

EugeneB
Level III

ユーザーが選択した 3D グラフの方向から 2D XY 座標列の生成を自動化するスクリプトを生成しています。スクリプトは計算を実行するために R コードを呼び出しますが、XYZ 列データと回転設定を R に提供する必要があります。

保存された散布図 3D スクリプトから、XYZ 列名 (zue1...) と回転設定 (-8....) を確認できます。これらの列を選択して csv ファイルをエクスポートするには、jsl コードが必要です。また、回転設定の値を選択してエクスポートするコードも必要です。

アドバイスをいただければ幸いです。

Scatterplot 3D(
	Y( :zue1, :zue2, :zue3 ), 
	Frame3D(
		Set Grab Handles( 0 ),
		Set Rotation( -8.15592033195416, 47.3040538060599, 75.4291344975828 )
	)
);

この投稿のオリジナルは 、English (US) で書かれており、ユーザビリティ向上のため自動翻訳機能を使用して表示しています。コメントを投稿すると、オリジナルの言語(English (US))やご指定の言語 でも表示されます。

5 条回复5
ian_jmp
Level X

Re:3D散布図プロットスクリプトから回転列とデータ列を選択します

CSVファイルを仲介として使用するのではなく、 JMPとRの統合

この投稿のオリジナルは 、English (US) で書かれており、ユーザビリティ向上のため自動翻訳機能を使用して表示しています。コメントを投稿すると、オリジナルの言語(English (US))やご指定の言語 でも表示されます。

txnelson
Super User

Re:3D散布図プロットスクリプトから回転列とデータ列を選択します

@ian_jmp JMPからRルーチンを呼び出すという提案は、問題を解決するための優れた方法かもしれません。

本当にcsvパススルーデータテーブルを使用する必要がある場合は、csvファイルの作成を実行する1つの方法の簡単な例を次に示します。

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
sp = Scatterplot 3D(
 Y( :age, :height, :weight ),
 Frame3D( Set Grab Handles( 0 ), Set Rotation( -54, 0, 38 ) )
);
sp << on close(
 theScript = Char( (Report( sp ) << get scriptable object) << get script );
 varsList = {};
 Insert Into( varsList, Word( 2, Substr( theScript, Contains( theScript, "Y(" ) ), ":," ) );
 Insert Into( varsList, Word( 4, Substr( theScript, Contains( theScript, "Y(" ) ), ":," ) );
 Insert Into( varsList, Word( 6, Substr( theScript, Contains( theScript, "Y(" ) ), ":,)" ) );
 rotationList = {};
 Insert Into( rotationList, Word( 2, Substr( theScript, Contains( theScript, "Rotation(" ) ), "()," ) );
 Insert Into( rotationList, Word( 3, Substr( theScript, Contains( theScript, "Rotation(" ) ), "()," ) );
 Insert Into( rotationList, Word( 4, Substr( theScript, Contains( theScript, "Rotation(" ) ), "()," ) );
 dtSub = dt << subset( columns( Eval( varsList ) ), selected rows( 0 ) );
 dtSub << New Column( "_Vars_", character, set values( varsList ) );
 dtSub << New Column( "_Rotation_", character, set values( rotationList ) );
 dtSub << Save( "$TEMP/passvalues.csv" );
 close( dtSub, nosave );
);

// This line opens the csv back into JMP 
//open("$TEMP/passvalues.csv");

この投稿のオリジナルは 、English (US) で書かれており、ユーザビリティ向上のため自動翻訳機能を使用して表示しています。コメントを投稿すると、オリジナルの言語(English (US))やご指定の言語 でも表示されます。

EugeneB
Level III

Re: Select rotation and data columns from 3D scatterplot plot script

Thanks to you both.  We will pass the values directly to R as you suggest.   However..... our fundamential question (which was lost in framing our goal overall) is......   how can we have a jsl script select the rotation values (-8...)   and  the column data (zue1,... in this exmple) to pass to R.  We want the user to make a desired 3D projection, orient it as desired, and then have the script generate a 2D projection from that orientation.   We need to access and select the  rotation values, from (or as seen in) the saved 3D scatterplot script.   We'd also like the script or addin we make automatically select (for export to R) the  column data used, so select the XYZ column data used for the original 3D plot.

 

 

 

Here is the 3D scatterplot script.... 

 

thanks!

Scatterplot 3D(
	Y( :zue1, :zue2, :zue3 ), 
	Frame3D(
		Set Grab Handles( 0 ), 
		Set Rotation( -8.15592033195416, 47.3040538060599, 75.4291344975828 )
	)
);
txnelson
Super User

Re: Select rotation and data columns from 3D scatterplot plot script

Please take the time again to review the JSL I provided.  It's example, runs a Scatterplot 3D, where you can change the rotation to where ever you want it, then upon closing of the window, it extracts the script for the example, and strips out the variables and the rotation values from the example just run.  It then creates a csv file and saves it to disk.  If you do not want the complete code I provided, you can easily see the code that I used to strip out the variables and rotation values, placing them into JMP Lists called varsList and rotationList.

Jim
EugeneB
Level III

Re: Select rotation and data columns from 3D scatterplot plot script

Oh I see that your script has (I think) what we need within it. thanks. Willl try to implement using these insights.