导出 MMA8 中损坏的一行图形对象

发布于 2024-12-04 17:21:27 字数 867 浏览 3 评论 0原文

如何让Mathematica导出图形。我不喜欢 GraphicsRow 处理图形的方式,图形中的所有长宽比和填充都变得混乱。我喜欢做的是处理每个单独的图形,然后使用简单的 RowColumnGrid 来组合我的图形。以下面的例子为例:

g1 = Plot[Sin[x], {x, -Pi, Pi}, 
      Frame -> True, FrameLabel -> {"x", "y"}, ImageSize -> 2.6*72
    ]

这创建了 Sin 图。我现在要做的是创建下图:

Fig = Row[{g1, g1, g1}]

output

然后就可以使用 Export

Export["TestFig.pdf", Fig]

这个是我在 MMA8 中获得的 pdf:

output

我刚刚在 MMA7 中尝试了这段代码,它工作正常。我已经有一段时间没有想创建这种类型的人物了,而且我从来没有费心去检查它在 MMA8 中是否有效。有人在 MMA8 中解决这个问题吗?

所需的输出是我在 MMA7 中获得的输出:

desired Output

How do you make Mathematica export a Row of graphics. I do not like how GraphicsRow handles the graphics, all the aspect ratios and paddings in the figures get messed up. What I like to do is work with each individual figure and then use a simple Row,Column or Grid to combine my figures. Take the following for instance:

g1 = Plot[Sin[x], {x, -Pi, Pi}, 
      Frame -> True, FrameLabel -> {"x", "y"}, ImageSize -> 2.6*72
    ]

This creates the Sin plot. What I want to do now is create the following Figure:

Fig = Row[{g1, g1, g1}]

output

Then you can use Export

Export["TestFig.pdf", Fig]

This is the pdf I obtain in MMA8:

output

I just tried this code in MMA7 and it works fine. It had been a while since I wanted to create this type of figures and I never bothered to check if it worked in MMA8. Does any one have a fix for this in MMA8?

The desired output is the one I obtained in MMA7:

desired Output

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

メ斷腸人バ 2024-12-11 17:21:27

值得记住的是 GraphicsGrid 假设等宽columns 因此使用 Grid 有时更有用。与贝利撒留的回答中的语法相同。可能值得探索 ExportImageSize 选项(请参阅文档教程)。

另外,请注意以 PDF 格式导出使用 PrintingStyleEnvironment,这不是事情的方式看在屏幕上。如果您在打印设置中更改页面设置,可能会获得更好的结果。

It is worth bearing in mind that GraphicsGrid assumes equal-width columns so using Grid is sometimes more useful. The same syntax as in belisarius' answer applies. It might be worth exploring the ImageSize option to Export (see documentation and tutorial).

Also, note the exporting in PDF format uses the PrintingStyleEnvironment, which is not how things look on screen. You might get better results if you change your page setup in Printing Settings.

入画浅相思 2024-12-11 17:21:27
Export["c:\\TestFig.pdf", GraphicsGrid[{{g1, g1, g1}}]]

在此处输入图像描述

Export["c:\\TestFig.pdf", GraphicsGrid[{{g1, g1, g1}}]]

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文