【问题标题】:SAS - how to put multiple graphs into one pageSAS - 如何将多个图表放入一页
【发布时间】:2013-11-23 16:27:06
【问题描述】:

尝试使用 SAS 将多个图形(来自 proc sgplot)放入一页 PDF 中,需要您的帮助。请问有什么好的解决办法吗?

由于图形是使用 proc sgplot 创建的,因此没有结果存储在 SAS 目录中,这使得 proc greplay 无法工作。我还尝试将 png 存储在光盘中并将它们读回 SAS,然后运行 ​​greplay。但是,在此期间图表的质量会下降。

这是一个大报告,需要每周刷新,手动工作将是一场灾难......

谢谢。

【问题讨论】:

  • 谢谢。更具体地说,这些图表是基于 diff 数据集创建的,我想将 3 放在 row1 中,将 1 放在 row2 中。我想知道ods布局是否可以满足要求。你能告诉我一个例子吗?谢谢:)

标签: pdf sas sas-ods


【解决方案1】:

查看 ODS 语句中的 startpage= 选项。具体来说,startpage=no 只会在当前页面已满时开始新页面。 startpage=yes 是默认值,并在每个 PROC 边界上开始一个新页面。

【讨论】:

  • 感谢您的建议。如果我想在一页中显示 4 个图表:第 1 行中的 3 个和第 2 行中的 1 个,那么 startpage 是否有效?谢谢。
  • 我不这么认为。您可以指定列数,但我认为它会首先填充列,而不是行(如杂志布局)。您可能需要查看 ODS 布局。另一个选项是在 PROC TEMPLATE 和 PROC SGRENDER 中指定布局。我使用了 TEMPLATE 和 SGRENDER 选项,一旦您了解文档,就会发现它相当直观。更多信息请查看support.sas.com
【解决方案2】:

我以前试过这个,发现它有很多错误,但如果你有兴趣尝试一下,这应该可以满足你的要求。只需更改 x、y、宽度和高度以适合每个区域所需的大小。

ods pdf file='file.pdf' startpage=no;

ods layout start width=8in height=10.5in; /*identify width and height of entire page leaving room for margins*/
ods region x=0in width=2.25in y=0in height=5in; /*identify region boundaries*/
{code with output}
ods region x=2.5in width=2.25in y=0in height=5in; /*identify region boundaries*/
{code with output}
ods region x=5in width=2.25in y=0in height=5in; /*identify region boundaries*/
{code with output}
ods region x=0in width=8in y=5.25in height=5in; /*identify region boundaries*/
{code with output}
ods layout end;

x=水平起点

width=区域宽度(x+width=水平终点)

y=垂直起点

height=区域高度(y+height=垂直终点)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-11
    • 2018-10-23
    • 1970-01-01
    • 1970-01-01
    • 2015-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多