有没有办法将gnuplot的图表合并到winform中
你好 对于我的控制台应用程序,我一直使用 gnuplot 来绘制图表。然而现在我正在为我的应用程序创建 GUI,在我看来,在表单之外打开的 Gnuplot 图表窗口看起来会很难看。所以我想知道是否有任何方法可以将外部 gnuplot 图表窗口合并到 winform 中
Hi
For my console application I've been using gnuplot to draw charts. However now I'm creating GUI for my application and in my opinion Gnuplot chart window opening outside of form will be look ugly. So I was wondering if there is any way to somehow incorporate external gnuplot chart window into winform
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
实现这一目标的最原始方法是使 gnuplot 将图形输出为 PNG 文件(通过 设置输出 选项),然后在操作完成后将其加载到 winform 中。您需要 System.Diagnostics 命名空间来启动gnuplot。
The most primitive way of achieving that would be to make gnuplot output a the graph as a PNG file (via the set output option) and then loading that into your winform once the operation completes. You'll want the System.Diagnostics namespace for launching gnuplot.
您可能想使用诸如 zedgraph 之类的其他东西或 C# 中的许多其他可能性来在 GUI 中显示绘图。这样,您甚至可以实现与绘图本身的一些交互,而这用 gnuplot 很难实现。
You might want to use something else like zedgraph or many other possibilities in C# to display plots in your GUI. Like that, you can even achieve some interaction with the plot itself, which would be very hard to realize with gnuplot.
诺维科夫有权利这样做,但是 GNUplot 中有交互式图表类型,并且所有绘图在 GNUplot 查看器窗口中查看时都是交互式的。
也许最好的解决方案是两者兼而有之。默认情况下显示静态 .png,但提供一个按钮来启动 GNUplot 窗口以实现交互。
Novikov has the right of it, but there ARE interactive chart types in GNUplot, and all plots, while viewed in the GNUplot viewer window, are interactive.
Perhaps the best solution is to do both. Display the static .png by default, but offer a button to launch the GNUplot window for interactivity.
Gnuplot 可以采用配置绘图的命令文件并将绘图输出为 GIF、PNG 或各种其他格式。然后您可以在图像查看器中显示输出。
Gnuplot can take a command file that configures a plot and output the plot to a GIF, PNG or various other formats. You can then display the output in an image viewer.