你好,我有一个二进制二维矩阵的图像。
有没有办法可以在 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. 现在需要将数据堆叠成基本上一列零和一。使用
表==>堆栈
平台,将所有列,“列 2”到“列 26”复制到堆栈列中。
3. 在“非堆叠列”部分,选中“选择”复选框,然后选择“行”列。
3.点击确定
4. 在新的堆积数据表中,新建一个名为“Column”的列,并将公式设置为
数字(字(-1,:标签,“”))
这将从标签列中获取列号,并将其设置为新列中的数值
5.打开Graph Builder平台
图表==>图表生成器
6.将Row列拖到Y放置区
7.将Column列拖到X放置区
8. 右键单击图表并选择
更平滑==>删除
9. 将数据列拖到颜色放置区
10. 右键单击图例中 0 的彩色点并选择
颜色==>白色
11.右键单击segend中1的彩色点并选择
颜色==>黑色
你会得到这个图表

其他方法也可用。