使用 Cern ROOT 绘图
我正在尝试创建一个图表并将其另存为图像。我需要使用ROOT。我创建了图表,
TGraph graph = TGraph(xvect, yvect);
但现在我陷入了如何将其保存为 png(或其他图像格式)的困境。我正在使用 Linux 机器,如果这有什么区别的话。另外,如果有人知道描述将图形写入图像文件的方法的文档链接,我可以从那里自己找出答案,但到目前为止我还没有在文档中成功找到它。
I am trying to create a graph and save it as an image. I am required to use ROOT. I created the graph with
TGraph graph = TGraph(xvect, yvect);
but now I'm stuck on how to get that saved as a png (or other image format). I'm using a linux machine if that makes a difference. Also, if anyone knows link to the documentation that describes the method for writing the graph to an image file, I could figure it out myself from there, but I have been unsuccessful in finding that in the documentation thus far.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
肯定会在 cint shell 中工作。它可能需要一些微调才能在编译的代码中工作。
您会发现所有这些基本内容都在在线教程和< a href="http://root.cern.ch/drupal/content/howtos" rel="nofollow">HowTos。另请参阅一般文档。
Will certainly work in the cint shell. It may need some fine-tuning to work in compiled code.
You'll find all this basic stuff exhaustively covered in the on-line tutorials and HowTos. Also see the documentation in general.
SaveAs 是我在根目录中保存图形的常用函数。
附带说明一下,正如 dmckee 所说,在线文档非常有用。
班级列表
SaveAs has been my go to function for saving graphs in root.
As a side note the online documentation is very useful as dmckee said.
class list
完整的宏将是:
The complete macro will be: