Lumiera  0.pre.03
»edit your freedom«
gnuplot-gen.hpp File Reference

Go to the source code of this file.

Description

Preconfigured setup for data visualisation with Gnuplot.

The visualisation tool gnuplot allows for simple data visualisation in various formats, integrated into a *NIX commandline work environment.

The namespace lib::gnuplot_gen allows to generate diagrams relying on some common layout schemes, which can be customised. Data is passed in as CSV string; the generated Gnuplot script adapts dynamically to the number of data columns given, where the first column always holds the common x-axis values. Additional parameters can be added to the data binding used for script generation; this binding is comprised of key = value settings in a Rec<GenNode> (Lumiera's »ETD« format for structural data)

Todo:
3/2024 this is an initial draft, shaped by the immediate need to visualise measurement data collected while testing the new Scheduler implementation.
See also
GnuplotGen_test
SchedulerStress_test
text-template.hpp

Definition in file gnuplot-gen.hpp.

#include "lib/stat/csv.hpp"
#include "lib/format-util.hpp"
#include "lib/diff/gen-node.hpp"
#include <string>
#include <vector>
#include <tuple>

Typedefs

using ParamRecord = diff::Rec::Mutator
 < preconfigured setup for Gnuplot data visualisation
 

Functions

string dataPlot (string csvData)
 
string dataPlot (ParamRecord)
 Generate a Gnuplot diagram to visualise the given data points. More...
 
string scatterRegression (string csvData)
 
string scatterRegression (ParamRecord)
 Generate a (X,Y)-scatter plot with regression line. More...
 

Variables

const string KEY_CSVData = "CSVData"
 
const string KEY_DiagramKind = "DiagramKind"
 
const string KEY_RegrSlope = "RegrSlope"
 
const string KEY_RegrSocket = "RegrSocket"
 
const string KEY_Term = "Term"
 
const string KEY_TermSize = "TermSize"
 
const string KEY_Xlabel = "Xlabel"
 
const string KEY_Xrange = "Xrange"
 
const string KEY_Xtics = "Xtics"
 
const string KEY_Y2label = "Y2label"
 
const string KEY_Y2range = "Y2range"
 
const string KEY_Y3label = "Y3label"
 
const string KEY_Y3range = "Y3range"
 
const string KEY_Ylabel = "Ylabel"
 
const string KEY_Yrange = "Yrange"
 

Namespaces

 lib
 Implementation namespace for support and library code.
 

Function Documentation

◆ dataPlot()

string dataPlot ( ParamRecord  params)

Generate a Gnuplot diagram to visualise the given data points.

Remarks
each column of the given data is featured as sequence over the first column interpreted as common abscissa. The name of the abscissa and the row names in the legend are extracted from the header names expected in the first row of CSV data.

Definition at line 241 of file gnuplot-gen.cpp.

References lib::gnuplot_gen::dataPlot().

Referenced by lib::gnuplot_gen::dataPlot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scatterRegression()

string scatterRegression ( ParamRecord  params)

Generate a (X,Y)-scatter plot with regression line.

Remarks
the layout of this diagram differs, based on the given number of data columns. The main measurement data is expected in columns [1:2] and showed in the primary display, adding a regression line. When further columns are given, a multiplot layout is established, showing those additional related series in a second diagram below. It may be necessary to define a larger canvas with different aspect ratio, which is possibly using the placeholder #KEY_TermSize

Definition at line 265 of file gnuplot-gen.cpp.

References lib::gnuplot_gen::scatterRegression().

Referenced by lib::gnuplot_gen::scatterRegression().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: