将一个图叠加到另一个图上伙计们,
如第一个附件所示,将另一个图形叠加到另一个图形上的方法(或最佳方法)是什么? 最终目标是生成多个绘图,将它们排列在一个保存为表格属性的窗口中。 然后运行此表格属性,以便能够将最终合成图片复制并粘贴到 Powerpoint。
到目前为止,我拥有的脚本几乎可以让我到达那里(请参阅附加的脚本和第二个附件)。 我当前的脚本显然会进入每个生成的图表的报告中,并且使用“获取图片”命令来填充阵容框。 我试图将直方图仅视为图像,并执行“添加图像”,但无法使其正常工作。
如果添加图像命令是要走的路,我的附加问题是如何适当地提出“边界”参数以正确定位?
尼尔
cr = Current Data Table() << Run Script("Cumulative Resistivity");
rpt_cr = Report(cr);
rpt_cr_pic = rpt_cr[PictureBox(1)] << Get Picture;
ds = Current Data Table() << Run Script("Distribution");
rpt_ds = Report(ds);
rpt_ds_pic = rpt_ds[ListBox(4)] << Get Picture;
//comb = New Image( rpt_ds_pic );
//rpt_cr_pic << Add Image( comb, bounds(left(0), top(500),bottom(0),right(724)));
nw = Eval Expr( New Window("BR",
a = V List Box(
Lineup Box(N Col(2), rpt_cr_pic, rpt_ds_pic ),
)
)
);
Current Data Table() << New Script("RP", nw) ;


图形脚本编写回复:将图形叠加到另一个图形上为了清楚起见,我试图将一张图(通过获取图片)覆盖在另一张图上。
因此,根据脚本,我正在获取“rpt_ds_pic”图片并尝试覆盖到 rpt_cr_pic 上。 但是,我只获得了输出的 rpt_cr_pic,添加的图片没有显示。
我已经阅读了脚本索引(添加图像)和脚本指南,但显然我没有掌握使这项工作发挥作用的基本概念。
任何提示或方向都会非常有帮助。
非常感谢。
尼尔
cr = Current Data Table() << Run Script("Cumulative Resistivity");
rpt_cr = Report(cr);
rpt_cr_pic = rpt_cr[PictureBox(1)] << Get Picture;
ds = Current Data Table() << Run Script("Distribution");
rpt_ds = Report(ds);
rpt_ds_pic = rpt_ds[PictureBox(1)] << Get Picture;
comb = New Image( rpt_ds_pic );
rpt_cr_pic << Add Image( comb, bounds(left(0), top(500),bottom(0),right(724)));
nw = Eval Expr( New Window("BR",
a = V List Box(
Lineup Box(N Col(2), rpt_cr_pic, /*rpt_ds_pic*/ ),
)
)
);
Current Data Table() << New Script("RP", nw) ;
回复:将图形叠加到另一个图形上你好,
我知道这样做的唯一方法如下:
1)获取您的图像并为它们获取像素矩阵。
2) 用“上”图像的像素矩阵覆盖“下”图像像素的子矩阵。
下面是说明这一点的脚本,以及显示结果的图像(实际上是 3 个图像的窗口,其中“顶部”图像已“粘贴”在不同位置)。 您可能必须尝试将图像放在您想要的位置,但这种方法最终应该可以解决问题。
names default to here(1);
//make a table
dt = astable(J(50,2,randomuniform()));
//make a graph
gb = dt << Graph Builder(
Size( 500, 500 ),
Show Control Panel( 0 ),
Variables( X( :col1 ), Y( :col2 ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
);
//save to a picture, get the pixels and get the picture's x and y dimemnsions
pic1 = (report(gb)[framebox(1)] << get picture) << get pixels;
pic1y = nrow(pic1);
pic1x = ncol(pic1);
//now make another graph and do the same
dist = dt << distribution(histograms only, y(:col1));
pic2 = (report(dist)[framebox(1)] << get picture) << get pixels;
pic2y = nrow(pic2);
pic2x = ncol(pic2);
//create a window to place the resulting images
nw = new window("xx",
vlb = vlistbox(
)
);
x = y = 1; //initial "corner" of overwritten pixels... we will increment these and do 3 total pictures
for(i = 1, i<=3, i++,
newPic = pic1;
newPic[ y::(y+pic2y-1), x::(x+pic2x-1), ] = pic2;
vlb << append(picturebox(new image(newPic)));
y += 60;
x+= 150;
);

干杯,
布雷迪
回复:将图形叠加到另一个图形上布雷迪,
我今天早些时候得到了一些似乎有效的东西,但我也想尝试一下你的方法。
基于脚本索引中的“添加图像”命令(和示例),我能够获得如下所示的图像。 我唯一的问题是图形框似乎是唯一允许我获得结果的显示元素框。 此外,X 和 Y 轴仍然存在,我不知道如何隐藏它们。 附上我的代码。
尼尔

回复:将图形叠加到另一个图形上cr = Current Data Table() << Run Script("Cumulative Resistivity");
rpt_cr = Report(cr);
rpt_cr_pic = rpt_cr[PictureBox(1)] << Get Picture ;
Print(rpt_cr_pic << Get Size);
cp = Current Data Table() << Run Script("Cumulative Permeability");
rpt_cp = Report(cp);
rpt_cp_pic = rpt_cp[PictureBox(1)] << Get Picture;
Print(rpt_cp_pic << Get Size);
ds = Current Data Table() << Run Script("Distribution");
rpt_ds = Report(ds);
rpt_ds_pic = rpt_ds[PictureBox(1)] << Get Picture;
g = Graph Box(
FrameSize( 750, 1000 ),
X Scale( 0, 100 ),
Y Scale( 0, 100 ),
<<ADD image=""></ADD>