将日记另存为 PNG(或 PDF)我正在尝试将一个非常基本的表格保存为 PNG(或 PDF)。我可以用我的表创建日记,但无法正确保存它。通过阅读此留言板并查阅脚本指南,以下内容应该可以工作,但实际上并没有保存任何内容。
任何帮助,将不胜感激。
Names default to here(1);
dt = current data table();
path_to_results=Pick Directory("Results folder");
r = Column Dialog(
cats = Col List("Categories", Max Col( 10 ), MinCol( 0 )),
);
cat = r["cats"];
st = Data Table( Eval(TableName) ) <<
Summary(
Group(
:Label1,
Eval(cat)
)
);
jrn = st << Journal;
jrn << SavePDF( path_to_results||"categorychart.pdf");回复:将日记保存为 PNG(或 PDF)和@SDF1有一个使用仪表板的出色解决方案。
https://community.jmp.com/t5/Discussions/Save-Graph-amp-Datatable-and-output-as-png-file/mp/221844#M44269
回复:将日记保存为 PNG(或 PDF)抱歉,我错过了数据表位。 当尝试为展示盒拍照时,数据表的作用并不像分析平台。 这是另一种方法,使用日记盒。
dt = Open( "$sample_data/Cereal.jmp" );
journaltext = (Window( dt )) << getjournal;
journalbox = Journal Box( journaltext );
image = journalbox << getpicture;
New Window( "image", image );
pdf = journalbox << savepdf( "$temp/cereal.pdf" );
Open( "$temp/cereal.pdf" );
image capture of tableimage capture of table桌子的图像捕获
您可以使用以下方式保存图像
journalbox << savepicture( "$temp/cereal.png", "png" );
回复:将日记保存为 PNG(或 PDF)要关闭这个。我能够找到解决方案来完成我想做的事情。
我编写了一个函数来在新窗口中显示我的表格,然后将该新窗口保存为 png 文件。
SplitChartCreator = Function({dt,path_to_results},{Default Local},
r = Column Dialog(
split = Col List("Split Columns", Max Col( 10 ), MinCol( 0 )),
);
splits = r["split"];
st = dt <<
Summary(
Group(
:Lot,
:Wafer,
Eval(splits)
)
);
st << Delete Columns ( "N Rows" );
tb = Table Box();
For (i=1,i<=NCols(st),i++,
col = Column(st,i);
colName = col << Get Name;
lstValues = col << Get Values;
type = col << Get Data Type;
If (type=="Character",
tb << Append(
String Col Box(colName,lstValues)
)
,
tb << Append(
Number Col Box(colName,lstValues)
)
);
);
content = H List Box(
Outline Box("splitchart", << Outline Close Orientation("Vertical"),
tb
)
);
pw = New Window("splitchart", content);
img = pw << getpicture();
img << saveImage(path_to_results||"splitchart.png", "png");
Close(st, NoSave);
pw << Close Window();
);回复:将日记保存为 PNG(或 PDF)是的。@Wendy_Murphrey刚刚发布一个xpath方式导航到显示框树中的节点,或者可以使用显示框下标。 当您到达正确的节点时,将其另存为 PNG。 像这样使用显示框下标。
from the top left red triangle in the report, Edit->Show Tree Structurefrom the top left red triangle in the report, Edit->Show Tree Structure从报告左上角的红色三角形中,编辑 -> 显示树结构
使用显示树结构命令来识别您需要的报告部分。 此处,图片框(1) 捕获整个部分没有标题的图表。 然后,像这样使用 JSL:
dt = Open( "$sample_data/big class.jmp" );
dist = dt << Distribution(
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) )
);
boxtree = Report( dist );
picbox = boxtree[Picture Box( 1 )];
picbox << savepicture( "$desktop/distrib.png", "png" );
The captured PNG fileThe captured PNG file捕获的PNG文件
当我设置 picbox 变量时,我不确定拍照的命令是什么。 我用它来找出该框可用的命令:
showproperties(picbox)
并在列表中找到了这个:
save picture commandsave picture command保存图片命令
然后您可以在脚本索引中查找:
Help->Scripting IndexHelp->Scripting Index帮助->脚本索引
回复:将日记保存为 PNG(或 PDF)谢谢。这确实解决了 SavePDF 功能的问题,但可惜这并没有达到我想要的效果。实际上,我需要做的是将小桌子保存为图像,而不是所有额外的内容。关于如何只保存带有表格的 PNG 有什么建议吗?可能类似于在新窗口中创建表格,然后将新窗口的图像保存为 PNG 格式。
回复:将日记保存为 PNG(或 PDF)在 JMP 14 中,<
jrn=currentjournal();
然后保存pdf。