Lumiera  0.pre.03
»edit your freedom«
gnuplot-gen.hpp
Go to the documentation of this file.
1 /*
2  GNUPLOT-GEN.hpp - setup for simplified data visualisation via Gnuplot
3 
4  Copyright (C)
5  2024, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
39 #ifndef LIB_GNUPLOT_GEN_H
40 #define LIB_GNUPLOT_GEN_H
41 
42 
43 #include "lib/stat/csv.hpp"
44 #include "lib/format-util.hpp"
45 #include "lib/diff/gen-node.hpp"
46 
47 #include <string>
48 #include <vector>
49 #include <tuple>
50 
51 using std::string;
52 
53 namespace lib {
54 namespace gnuplot_gen {
55 
56 
57 
59 
60  const string KEY_CSVData = "CSVData";
61  const string KEY_DiagramKind = "DiagramKind";
62 
63  const string KEY_Term = "Term";
64  const string KEY_TermSize = "TermSize";
65 
66  const string KEY_Xtics = "Xtics";
67  const string KEY_Xrange = "Xrange";
68  const string KEY_Yrange = "Yrange";
69  const string KEY_Y2range = "Y2range";
70  const string KEY_Y3range = "Y3range";
71  const string KEY_Xlabel = "Xlabel";
72  const string KEY_Ylabel = "Ylabel";
73  const string KEY_Y2label = "Y2label";
74  const string KEY_Y3label = "Y3label";
75 
76  const string KEY_RegrSocket = "RegrSocket";
77  const string KEY_RegrSlope = "RegrSlope";
78 
79 
80 
84  string dataPlot (ParamRecord);
85 
86  inline string
87  dataPlot (string csvData)
88  {
89  return dataPlot (ParamRecord().set (KEY_CSVData, csvData));
90  }
91 
92 
97 
98  inline string
99  scatterRegression (string csvData)
100  {
101  return scatterRegression (ParamRecord().set (KEY_CSVData, csvData));
102  }
103 
104 
105 }} // namespace lib::gnuplot_gen
106 #endif /*LIB_GNUPLOT_GEN_H*/
Encoding and decoding of data into CSV format.
string scatterRegression(ParamRecord params)
Generate a (X,Y)-scatter plot with regression line.
string dataPlot(ParamRecord params)
Generate a Gnuplot diagram to visualise the given data points.
Implementation namespace for support and library code.
Generic building block for tree shaped (meta)data structures.
Collection of small helpers and convenience shortcuts for diagnostics & formatting.