The part that makes me dissatisfied with developing programs in C ++ is the library for graphs. There are people around me who write graphs in Excel, I don't use Excel much in the following ways:
・ When the number of data exceeds 20,000 (Note 1) ・ When you want to write a histogram (Note 2) ・ When you want to clearly distinguish between data, processing, and drawing ・ When you want to use it cross-platform on Windows and Linux
-Use Matplotlib from python. Reason 1: I'm used to matplotlib from Python on a daily basis Reason 2: It is enough if the data is file-based and the python script is operated internally. Reason 3: I don't know a free library that works on windows and Linux and can be used for commercial development.
If you use the method introduced in matplotlib-cpp From C ++ to C ++ as if it were your own plot library It seems that matplotlib can be used.
Gnuplot is a very helpful program. I have used it in an environment such as Windows / Linux / Cygwin. It was very useful because it has less OS dependency and can draw graphs. The features shown below were very helpful. Gnuplot is still used in various programs to create graphs. Since I started using Matplotlib under the python environment, I've been using gnuplot less often. Features of Gnuplot You can write graphs with a short script for file-based data entry. Works well with command line tools (pipes) such as awk. You can output a graph in a Postscript file. Functions can be fitted using the non-linear least squares method.
Advantages of Matplotlib You can create graphs at a level comparable to MATLAB graphics. You can create multiple subplots in one figure. Functions for displaying images etc. are prepared.
Note 1: Excel graph specifications and restrictions [Data elements that can be included in one data series of 2-D graph 32,000](https://support.office.com/ja-jp/article/Excel-%E3%81%AE % E4% BB% 95% E6% A7% 98% E3% 81% 8A% E3% 82% 88% E3% 81% B3% E5% 88% B6% E9% 99% 90-16c69c74-3d6a-4aaf-ba35 -e6eb276e8eaa)
Note 2: How to write frequency distribution table and histogram in Excel Histogram in Excel (frequency distribution map)
I wrote something like this before. I want to use matplotlib from C ++
Some people have already written articles, so I will introduce them. Japanese with matplotlib Japanese settings for matplotlib and Seaborn axes Use Japanese for case law and graph titles in matplotlib
Recommended Posts