여러분, 안녕하세요,
jpg 이미지에 대한 질문이 있는데 JMP에 대한 문서를 찾을 수 없습니다.
제 경우에는 "jpg" 형식의 이미지가 약 3000개 들어 있는 폴더가 있습니다.
로컬 데이터 필터의 선택에 따라 그래프 빌더에 이러한 이미지를 "jpg" 형식으로 표시할 수 있기를 바랍니다.
예를 들어 :

여기에 다음 이미지가 표시되어야 합니다. obj "B" 및 유형 "2".
이 이미지는 내 폴더에서 "B_2.jpg"와 같이 이름이 지정됩니다.
당신의 도움을 주셔서 감사합니다 !
나는 이것이 당신이 요구하는 것에 가깝고 당신이 시작해야 한다고 생각합니다.
// https://community.jmp.com/t5/Discussions/Drawing-other-shapes-in-graph-builder/m-p/368186#M61806
NamesDefaultToHere(1);
// Open a table and do Bivariate
dt = Open("$SAMPLE_DATA/Big Class.jmp");
biv = dt << Bivariate(X(:height), Y(:weight));
// Add a local data filter (:sex plays the role of floor . . . )
df = biv << Local Data Filter( Add Filter( columns( :sex ) ));
// Get the title of the window
win = (biv << Report) << GetWindowTitle;
// Define a function that will update the background image on the Bivariate plot
f = Function( {a},
// Infer what value of :sex is currenly selected in the data filter
levRows = df << getFilteredRows;
lev = Column(dt, "sex")[levRows];
lev = lev[1];
Speak(lev);
// (Try to) remove an image that might already be there
Try(
imgSeg = Window(win)[FrameBox(2)] << FindSeg( PictSeg( 1 ) );
imgSeg << Remove;
);
// Add the 'corresponding' image
if(
lev == "M",
Window(win)[FrameBox(2)] << Add Image(Open("$SAMPLE_IMAGES/tile.jpg"), FillGraph),
lev == "F",
Window(win)[FrameBox(2)] << Add Image(Open("$SAMPLE_IMAGES/progress.gif"), FillGraph)
);
);
// Add a handler to the data filter so that when the user makes a selection the function 'f' is called
rs = df << Make Filter Change Handler( f );유사한 접근 방식을 취함 @ian_jmp 아래는 데이터 필터 선택을 기반으로 이미지를 표시하지만 Bivariate 또는 Graph Builder와 같은 JMP 플랫폼을 사용하지 않는 스크립트의 간단한 예입니다.단순히 이미지를 표시합니다.


Names Default To Here( 1 );
path = "c:\users\???\pictures"; // set the path to your image directory
// Filter out all non jpg files
files = Filter Each( {file}, Files In Directory( path ), Word( -1, file, "." ) == "jpg" );
// I create a dummy data table to use for an example
ob = {"A", "B", "C"};
dt = New Table( "Pictures", invisible,
add rows( N Items( files ) ),
New Column( "Obj", character, set each value( ob[Mod( Row(), 3 ) + 1] ) ),
New Column( "type", nominal, set each value( Col Cumulative Sum( 1, :obj ) ) ),
New Column( "ImagePath", character, set each value( files[Row()] ) )
);
:ImagePath << hide;
// Here is the working code that can be used against a data table that matches
// the example data table created above
// It uses a Make Row State Handler to handle the changing of images when
// the data filter values change
nw = New Window( "Example",
hlb = H List Box(
dt << Data Filter(
Location( {928, 247} ),
Mode( Include( 1 ) ),
Add Filter( columns( :Obj, :type ), Display( :type, N Items( 8 ) ) )
),
pb = Graph Box( Frame Size( 600, 600 ) )
)
);
pb( report )[axisbox( 2 )] << delete;
pb( report )[axisbox( 1 )] << delete;
theFunction = Function( {a},
If( N Rows( dt << get selected rows ) == 1,
Try( pb << delete );
hlb << append( pb = Picture Box( Open( path || "\" || dt:ImagePath[(dt << get selected rows)[1]], jpg ) ) );
pb << set height( 600 );
pb << set width( 600 );
,
Try( pb << delete );
hlb << append( pb = Graph Box( Frame Size( 600, 600 ) ) );
pb( report )[axisbox( 2 )] << delete;
pb( report )[axisbox( 1 )] << delete;
)
);
rs = dt << make row state handler( theFunction );