From f5abce1e6d9ed6c29d11c1d9abc64e9c1bd40d31 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Sun, 16 Jun 2019 19:15:40 +0200 Subject: [PATCH] added violin plots and an example demonstrating their usage/generation from random data --- JKQtPlotterBuildAllExamples.pro | 1 + doc/dox/examples_and_tutorials.dox | 3 + doc/dox/jkqtplotter.dox | 6 + doc/dox/whatsnew.dox | 3 +- doc/images/JKQTPGraphViolinplot_BoxViolin.png | Bin 0 -> 3094 bytes .../JKQTPGraphViolinplot_HBoxViolin.png | Bin 0 -> 3496 bytes .../JKQTPGraphViolinplot_HSmoothViolin.png | Bin 0 -> 7475 bytes .../JKQTPGraphViolinplot_HStepViolin.png | Bin 0 -> 3837 bytes .../JKQTPGraphViolinplot_SmoothViolin.png | Bin 0 -> 7559 bytes .../JKQTPGraphViolinplot_StepViolin.png | Bin 0 -> 3169 bytes .../JKQTPGraphViolinplot_ViolinBoth.png | Bin 0 -> 7534 bytes .../JKQTPGraphViolinplot_ViolinBottom.png | Bin 0 -> 3757 bytes .../JKQTPGraphViolinplot_ViolinHBoth.png | Bin 0 -> 6091 bytes .../JKQTPGraphViolinplot_ViolinLeft.png | Bin 0 -> 11509 bytes .../JKQTPGraphViolinplot_ViolinRight.png | Bin 0 -> 5158 bytes doc/images/JKQTPGraphViolinplot_ViolinTop.png | Bin 0 -> 3708 bytes ...TPViolinplotHorizontalElement_elements.png | Bin 0 -> 22058 bytes doc/images/JKQTPViolinplotVerticalElement.png | Bin 0 -> 16794 bytes examples/README.md | 1 + examples/simpletest_violinplot/README.md | 111 ++ .../jkqtplotter_simpletest_violinplot.cpp | 159 +++ .../jkqtplotter_simpletest_violinplot.pro | 27 + ...tplotter_simpletest_violinplot_and_lib.pro | 8 + lib/jkqtplotter.pri | 6 +- .../jkqtpgraphssinglecolumnsymbols.h | 5 +- lib/jkqtplotter/jkqtpgraphsviolinplot.cpp | 490 +++++++++ lib/jkqtplotter/jkqtpgraphsviolinplot.h | 222 ++++ .../jkqtpgraphsviolinplotstylingmixins.cpp | 978 ++++++++++++++++++ .../jkqtpgraphsviolinplotstylingmixins.h | 427 ++++++++ .../jkqtplotter_simpletest_violinplot_hor.png | Bin 0 -> 36798 bytes ...kqtplotter_simpletest_violinplot_small.png | Bin 0 -> 12155 bytes ...jkqtplotter_simpletest_violinplot_vert.png | Bin 0 -> 39019 bytes 32 files changed, 2443 insertions(+), 4 deletions(-) create mode 100644 doc/images/JKQTPGraphViolinplot_BoxViolin.png create mode 100644 doc/images/JKQTPGraphViolinplot_HBoxViolin.png create mode 100644 doc/images/JKQTPGraphViolinplot_HSmoothViolin.png create mode 100644 doc/images/JKQTPGraphViolinplot_HStepViolin.png create mode 100644 doc/images/JKQTPGraphViolinplot_SmoothViolin.png create mode 100644 doc/images/JKQTPGraphViolinplot_StepViolin.png create mode 100644 doc/images/JKQTPGraphViolinplot_ViolinBoth.png create mode 100644 doc/images/JKQTPGraphViolinplot_ViolinBottom.png create mode 100644 doc/images/JKQTPGraphViolinplot_ViolinHBoth.png create mode 100644 doc/images/JKQTPGraphViolinplot_ViolinLeft.png create mode 100644 doc/images/JKQTPGraphViolinplot_ViolinRight.png create mode 100644 doc/images/JKQTPGraphViolinplot_ViolinTop.png create mode 100644 doc/images/JKQTPViolinplotHorizontalElement_elements.png create mode 100644 doc/images/JKQTPViolinplotVerticalElement.png create mode 100644 examples/simpletest_violinplot/README.md create mode 100644 examples/simpletest_violinplot/jkqtplotter_simpletest_violinplot.cpp create mode 100644 examples/simpletest_violinplot/jkqtplotter_simpletest_violinplot.pro create mode 100644 examples/simpletest_violinplot/jkqtplotter_simpletest_violinplot_and_lib.pro create mode 100644 lib/jkqtplotter/jkqtpgraphsviolinplot.cpp create mode 100644 lib/jkqtplotter/jkqtpgraphsviolinplot.h create mode 100644 lib/jkqtplotter/jkqtpgraphsviolinplotstylingmixins.cpp create mode 100644 lib/jkqtplotter/jkqtpgraphsviolinplotstylingmixins.h create mode 100644 screenshots/jkqtplotter_simpletest_violinplot_hor.png create mode 100644 screenshots/jkqtplotter_simpletest_violinplot_small.png create mode 100644 screenshots/jkqtplotter_simpletest_violinplot_vert.png diff --git a/JKQtPlotterBuildAllExamples.pro b/JKQtPlotterBuildAllExamples.pro index c9dffb0628..47119df0c4 100644 --- a/JKQtPlotterBuildAllExamples.pro +++ b/JKQtPlotterBuildAllExamples.pro @@ -86,6 +86,7 @@ addSimpleTest(datastore_statistics_2d) addSimpleTest(datastore_regression) addSimpleTest(datastore_groupedstat) addSimpleTest(contourplot) +addSimpleTest(violinplot) #addSimpleTest(rgbimageplot_opencv) #addSimpleTest(imageplot_opencv) diff --git a/doc/dox/examples_and_tutorials.dox b/doc/dox/examples_and_tutorials.dox index 0d2a421b2b..81674e058b 100644 --- a/doc/dox/examples_and_tutorials.dox +++ b/doc/dox/examples_and_tutorials.dox @@ -62,6 +62,9 @@ All test-projects are Qt-projects that use qmake to build. You can load them int \image html jkqtplotter_simpletest_boxplot_small.png \subpage JKQTPlotterBoxplotsGraphs `JKQTPBoxplotVerticalGraph`, `JKQTPBoxplotHorizontalGraph`, ... + \image html jkqtplotter_simpletest_violinplot_small.png + \subpage JKQTPlotterViolinplotGraphs + `JKQTPViolinplotVerticalElement`, `JKQTPViolinplotHorizontalElement`, ... diff --git a/doc/dox/jkqtplotter.dox b/doc/dox/jkqtplotter.dox index 92ed87ccc2..f4ea364b2e 100644 --- a/doc/dox/jkqtplotter.dox +++ b/doc/dox/jkqtplotter.dox @@ -377,6 +377,9 @@ This group assembles graphs that show their data with symbols and optionally wit \image html jkqtplotter_simpletest_boxplot_small.png JKQTPBoxplotVerticalGraph, JKQTPBoxplotHorizontalGraph + + \image html JKQTPViolinplotVerticalElement.png + JKQTPViolinplotVerticalElement, JKQTPViolinplotHorizontalElement \see \ref jkqtptools_math_statistics_adaptors for shortcuts to calculate statistical properties of data and then adding a plot with the results. @@ -418,6 +421,9 @@ This group assembles graphs that show their data with symbols and optionally wit \image html geo_boxplot_small.png JKQTPBoxplotVerticalElement, JKQTPBoxplotHorizontalElement + + \image html JKQTPViolinplotVerticalElement.png + JKQTPViolinplotVerticalElement, JKQTPViolinplotHorizontalElement Examples: diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox index dd8a64fda7..3282888a0a 100644 --- a/doc/dox/whatsnew.dox +++ b/doc/dox/whatsnew.dox @@ -26,7 +26,7 @@ Changes, compared to \ref page_whatsnew_V2018_08 "v2018.08" include:
  • changed: using static const variables instead of #define for fixed default values (e.g. JKQTPImageTools::LUTSIZE, JKQTPImageTools::PALETTE_ICON_WIDTH, JKQTPlotterDrawinTools::ABS_MIN_LINEWIDTH, JKQTMathText::ABS_MIN_LINEWIDTH ...)
  • Updates to JKQTPlotter: