From 96202f845a9a0021e39dabd73d4698e1c904819d Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 3 Apr 2024 00:29:27 +0200 Subject: [PATCH] Library: example to schow the secondary diagram ...which is added automatically whenever additional data columns are present Result can only be verified visually * the upper diagram should show the first fibonacci points * a (correct) linear regression line should be overlayed in red * below, a secondary diagram should appear, with aligned axis * the row "one" in this diagram should be shown as impulses * the further rows "two" and "three" should be drawn as green points, using the secondary Y-axis (values 100-250) * Gnuplot can handle missing data points --- src/lib/gnuplot-gen.cpp | 3 +- tests/library/gnuplot-gen-test.cpp | 22 +++++++-- wiki/thinkPad.ichthyo.mm | 74 +++++++++++++++++++++--------- 3 files changed, 74 insertions(+), 25 deletions(-) diff --git a/src/lib/gnuplot-gen.cpp b/src/lib/gnuplot-gen.cpp index ce88e5ce8..cc0f6e642 100644 --- a/src/lib/gnuplot-gen.cpp +++ b/src/lib/gnuplot-gen.cpp @@ -153,11 +153,12 @@ if (plots > 1) { unset arrow 10 unset arrow 11 set border 2+8 + set key bmargin ${if Y2range} set yrange [${Y2range}] ${endif -} unset x2label +} unset xlabel set format x "" ${if Y2label } set ylabel '${Y2label}' ${endif diff --git a/tests/library/gnuplot-gen-test.cpp b/tests/library/gnuplot-gen-test.cpp index b48f8c9fc..0654f8c5d 100644 --- a/tests/library/gnuplot-gen-test.cpp +++ b/tests/library/gnuplot-gen-test.cpp @@ -115,7 +115,7 @@ namespace test{ ,{6,13} ,{7,21.55} }}); - cout << gnuplot < no multiplot layout - CHECK (not contains (gnuplot, "set multiplot")); + + gnuplot = gnuplot_gen::scatterRegression( + CSVData{{"step","fib","one","two","three"} + ,{{0,1 , 1.0, 170,200} + ,{1,1 , 0.1, 160,210} + ,{2,2 , 1.1, 150,220} + ,{3,3 , 0.0, "" ,230} + ,{4,5 , 1.1, 130,240} + ,{5,8 , 1.2, 120,250} + ,{6,13, 1.3, 110 } + ,{7,21, 1.4, 100 } + }}); + cout << gnuplot < using multiplot layout + CHECK (contains (gnuplot, "set multiplot")); + CHECK (contains (gnuplot, "\"step\",\"fib\",\"one\",\"two\",\"three\"")); + CHECK (contains (gnuplot, "0,1,1,170,200")); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index d8afb7f25..b14c24bf1 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -112386,8 +112386,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + @@ -114345,7 +114345,7 @@ std::cout << tmpl.render({"what", "World"}) << s - + @@ -114443,14 +114443,14 @@ std::cout << tmpl.render({"what", "World"}) << s - - + + - - + + @@ -114507,7 +114507,9 @@ std::cout << tmpl.render({"what", "World"}) << s - + + + @@ -114567,30 +114569,31 @@ std::cout << tmpl.render({"what", "World"}) << s - - + + - - + + - - + + - - + + - + + - - + + @@ -114603,8 +114606,37 @@ std::cout << tmpl.render({"what", "World"}) << s - - + + + + + + + + + + + + + + + +

+ man kann hier eigentlich nur stichprobenartig verifizieren, daß das jeweilige Template zum Einsatz kam, und daß einige markante Werte per Text-Templating eingebaut wurden. Also z.B. die Datenheader, oder eine Achsenbeschriftung. +

+ + +
+
+ + + + + + + + +