Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Definition of building blocks and preconfigured styles for Gnuplot scripts.
The purpose of this setup is to generate visualisations of measurement data easily. A collection of plotting definitions, together with uniform styles is maintained within this translation unit, exposing a simple interface where the user only needs to supply the actual data to be plotted. Intentionally, this collection is started without much structure or preconceptions and written in a way to encourage adding more use-cases by copy-and-paste. Following this pragmatic approach, generalisations and common schemes will emerge eventually.
The resulting Gnuplot script is combined from several building blocks, and passed through the lib::TextTemplate engine to substitute the data and further configuration parameters at designated places into the code. Notably, the script performs further evaluations at run time, especially in reaction to the number of given data rows (relying on the stats
command of Gnuplot). Data input is configured to CSV format and data is pasted as »here document« into a data block variable $RunData
points
plotting style is used; this can be overridden through the placeholder #KEY_DiagramKind. All given data rows are combined into a single plot, using a common x and y axis, and assigning consecutive line drawing styles to each data row (from blue to green, yellow, red). A maximum of 9 line styles is prepared for drawing. The x/y-ranges and custom labels can be added.Definition in file gnuplot-gen.cpp.
#include "lib/text-template.hpp"
#include "lib/text-template-gen-node-binding.hpp"
#include "lib/gnuplot-gen.hpp"
#include "lib/format-util.hpp"
#include <string>
Functions | |
string | dataPlot (ParamRecord) |
Generate a Gnuplot diagram to visualise the given data points. More... | |
string | scatterRegression (ParamRecord) |
Generate a (X,Y)-scatter plot with regression line. More... | |
Variables | |
const string | GNUPLOT_AxisGridSetup |
const string | GNUPLOT_BASIC_PLOT_DEF |
const string | GNUPLOT_CommonStyleDef |
const string | GNUPLOT_SCATTER_REGRESSION |
const string | GNUPLOT_SIMPLE_DATA_PLOT |
Namespaces | |
lib | |
Implementation namespace for support and library code. | |
string dataPlot | ( | ParamRecord | params | ) |
Generate a Gnuplot diagram to visualise the given data points.
Definition at line 241 of file gnuplot-gen.cpp.
References lib::gnuplot_gen::dataPlot().
Referenced by lib::gnuplot_gen::dataPlot().
string scatterRegression | ( | ParamRecord | params | ) |
Generate a (X,Y)-scatter plot with regression line.
[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().