We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(9)
我总是写出数据,然后使用 gnuplot 创建图表。 这是迄今为止我发现的以各种格式生成图表的最佳方法:eps、png、jpeg、xpm,凡是你能想到的格式。
gnuplot
将非常容易地绘制散点图。 假设 x 和 y 值位于 2 个以空格分隔的列中,那么将为您提供快速散点图。 然后你可以调整它以及不使用其他 gnuplot 命令的内容。
如果您从事科学工作,那么学习
gnuplot
对您来说非常有价值。 它确实让制作 Excel 绘图变得一团糟,并且简化了制作包含在论文中的绘图的任务。I always write out data and then using gnuplot to create my graphs. It is by far the best way I have found of producing graphs in a variety of formats: eps, png, jpeg, xpm, you name it.
gnuplot
will do scatter plot very easily. Provided thex
andy
values are in 2 space-separated columnss, thenWill give you a quick scatter plot. Then you can adjust it and what not using other gnuplot commands.
If you are involved in sciences, then learning
gnuplot
will be very valuable to you. It kicks the crap out of doing excel plots for sure and it eases the task of making plots to include in papers.如果您正在寻找 C++ 库而不是像 gnuplot 这样的独立绘图工具,我会考虑以下内容:
dislin 似乎是两者中更有趣的一个。 以下是从维基百科文章中摘录的描述:
If you are looking for a C++ library rather than I independent plotting tool like gnuplot, I would consider the following:
dislin seems to be the more interesting of the two. Here is a description extracted from the wikipedia article:
非常重的解决方案:您可以链接到 ROOT,它将执行您想要的任何操作:
当然,它有点对于大多数人来说很多,但它确实满足了您的要求。 我使用它是因为我知道它并且它已经在我的机器上,因为我是那种物理学家。
Very heavy solution: you could link against ROOT, which will do just about anything you want:
Sure, its a bit much for most people, but it does do exactly what you asked for. I use it because I know it and it is already on my machines becase I'm that kind of physicist.
好老的 GNU,他们拥有一切......
http://directory.fsf.org/project/plotutils/
Good old GNU, they have everything...
http://directory.fsf.org/project/plotutils/
这当然不是最好的方法,但我通常编写可由 R 读取的输出文件并使用这与适当的脚本一起绘制图表。
This is certainly not the best way but I usually write output files that can be read by R and use this, along with an appropriate script, to plot the graphs.
这里的问题是,C++ 与 Java 不同,没有内置的 GUI 或图形。 如果您想使用 C++ 生成图形,您需要使用适用于您的操作系统的 GUI 库。 有免费的 GUI 库,许多跨平台的,例如 Qt 或 GTK。
然而,正如其他人指出的那样,最简单的方法是将数据保存到文本文件中,然后使用另一个程序生成图表。 gnuplot 绝对是一个不错的选择。 它是大多数 Linux 发行版的标准配置,您也可以在 cygwin 下获得 Windows 版本。
The problem here is that C++, unlike Java for example, does not have built-in GUI or graphics. If you want to generate graphs with C++ you would need to use a GUI library available for your OS. There are free GUI libraries, many cross-plaform such as Qt or GTK.
However, as other people have pointed out, the easiest thing for you to do would be to save the data into a text file, and use another program to generate the graph. gnuplot is definitely a good choice. It comes standard with most linux distros, and you get for Windows under cygwin.
向那些尚未使用 C++ 进行绘图的人致敬。 我会说我是如何用 C++ 绘制图形的
从 http://sourceforge.jp/projects/sfnet_gnuplot/downloads/gnuplot/4.4.3/gp443win32.zip/
将其解压到“C:\Gnuplot”中
然后我读了“C:\Gnuplot\gnuplot\README.Windows”
我得到了这些信息:
我使用的是 Windows 7 ==> 所以你需要下载“winhlp32.exe”...只需在搜索引擎中搜索“winhlp32.exe Windows 7”并浏览第一个链接。
将二进制文件夹的路径附加到“Path”环境变量,即“C:\Gnuplot\gnuplot\binary”
然后我关闭计算机并再次打开它。 当我发现它没有感觉到环境变量的变化:D
你现在需要编写一个示例代码来测试你的绘图能力:)
所以你可以访问这个链接
http://code.google.com/p/gnuplot -cpp/source/browse/#svn%2Ftrunk
查看头文件“gnuplot_i.hpp”和源文件“example.cc”。
您将获得很多很多图表,选择合适的图表,定制您的核心,然后享受:)
Regards plotting in C++ for anyone who didn't do it yet. I will say what I did to plot Graphs in C++
Download the zipped file "gp443win32.zip" from http://sourceforge.jp/projects/sfnet_gnuplot/downloads/gnuplot/4.4.3/gp443win32.zip/
Extract it in "C:\Gnuplot"
then I read "C:\Gnuplot\gnuplot\README.Windows"
and I got these information:
I used Windows 7 ==> so you need to download "winhlp32.exe"... just search for it "winhlp32.exe Windows 7" in a search engine and go through the first link.
Append to the "Path" Environment variable the path for binary folder which is "C:\Gnuplot\gnuplot\binary"
then I shutdown my computer and open it again. After I found that it didn't sense the change in the environment variables :D
you need now to write a sample code to test your plotting ability :)
so you can visit this link
http://code.google.com/p/gnuplot-cpp/source/browse/#svn%2Ftrunk
to see the header file "gnuplot_i.hpp" and source file "example.cc".
You will get many and many graphs, choose your appropriate graph, customize your core, and enjoy :)
如果您熟悉 matplotlib,则可以在 C/C++ 中嵌入 python应用程序。 根据您的需要,这可能是一个快速的解决方案。
If you're familiar with matplotlib, you can embed python in C/C++ applications. Depending on what you want it for, this might be a quick solution.
Chart Director 具有 C++ 绑定。 我使用过他们的 .Net 库,并且对它们非常满意。 这是一个非常便宜的库,并且使您能够制作各种不同的图表。
Chart Director has bindings for C++. I've used their .Net libraries, and I've been pretty happy with them. It's a pretty cheap library, and gives you the power to do all sorts of different charts.