你好,我有一個二進制二維矩陣的圖像。
有沒有辦法可以在 JMP 上繪製它? 該圖應該顯示一個黑點,而零則沒有。
附件是需要繪製的文件。
謝謝你的幫助!
這是另一種方法,使用 JSL 並創建圖像文件
// data preparation, the data table needs some work to get it ready
_dt = Current Data Table();
_dt << Select rows( 1 );
_dt << delete rows;
For( ii = 1, ii <= N Cols( _dt ), ii++,
Column( _dt, ii ) << Set Name( "phase_" || Char( ii - 1 ) );
Column( _dt, ii ) << Set Data Type( Numeric );
Column( _dt, ii ) << Set Modeling Type( Continuous );
);
// Make an image file and display in new window with scaling control
// this assumes the entire table just has the binary columns
// get the binary values as a matrix
m = _dt << get as matrix;
// get the dimensions of the table/matrix
mdim = Dim( m );
// specify a minimum image size in pixels, this prevents the image from being
// too small to be useful
mininumimagepixeldim = [800 800];
// determine a scale factor to bring the size of the matrix up to the minimum dimensions
// specified above
scale_x = Ceiling( mininumimagepixeldim[2] / mdim[2] );
scale_y = Ceiling( mininumimagepixeldim[1] / mdim[1] );
// create a scaled image matrix, using the scale factors determined above
// and applying the direct product to scale up the image
r = 1 - Direct Product( m, J( scale_y, scale_x, 1 ) );
// create an image from the scaled image matrix
img = New Image( "rgb", {r, r, r} );
scalefactor = 1;
// create the display window
_nw = New Window( "Binary Image",
Outline Box( "Binary Image",
// create a slider controller to rescale the image
// this works by recreated the image, applying the scale factor,
// deleting the image in the display and redrawing the new image
V List Box(
H List Box(
Text Box( "Move Slider to Scale Image " ),
Slider Box(
.5,
1,
scalefactor,
img = New Image( "rgb", {r, r, r} );
img << Scale( scalefactor );
_picb << delete;
_panelb << Append( _picb = Picture Box( img ) )
;
)
),
// draw the binary image inside a panel box (just to give it an outline and a container)
_panelb = Panel Box( "Binary Image", _picb = Picture Box( img ) )
)
)
);結果看起來像這樣

這裡有幾種方法可以做到這一點。第一個是細胞圖。為此,需要更正您的數據表。
1. 刪除第 1 行。
2.選擇所有列
3. 使用標準化屬性,將所有列從字符數據類型更改為數字數據類型。
4.使用Standardize Attributes,創建Value Colors的Column Property,設置值為0的顏色為白色,值為1的顏色為黑色
5. 運行細胞圖平台
圖形==>細胞圖
選擇所有列並將它們放入 Y 響應中,然後單擊確定

第二個例子是使用 Graph Builder
1. 以上面修改過的數據表為例,需要添加一個新的列來表示數據所在的行。 因此,添加一個名為“Row”的列並將其公式設置為
排()
2. 現在需要將數據堆疊成基本上一列的 0 和 1。使用
表==>堆棧
平台,將所有列,“列 2”到“列 26”複製到堆棧列中。
3. 在“非堆疊列”部分,選中“選擇”複選框,然後選擇“行”列。
3.點擊確定
4. 在新的堆積數據表中,新建一個名為“Column”的列,並將公式設置為
數字(字(-1,:標籤,“”))
這將從標籤列中獲取列號,並將其設置為新列中的數值
5.打開Graph Builder平台
圖表==>圖表生成器
6.將Row列拖到Y放置區
7.將Column列拖到X放置區
8. 右鍵單擊圖表並選擇
更平滑==>刪除
9. 將數據列拖到顏色放置區
10. 右鍵單擊圖例中 0 的彩色點並選擇
顏色==>白色
11.右鍵單擊segend中1的彩色點並選擇
顏色==>黑色
你會得到這個圖表

其他方法也可用。