- added new graph: JKQTPSingleColumnSymbolsGraph
- fixed additional renames JKQTPLotter->JKQTPlotter - improved documentation (boxplots, JKQTMathText) - added several examples
@ -25,9 +25,6 @@ jkqtplot_test.depends = jkqtplotterlib
|
||||
jkqtplotter_simpletest.file = examples/simpletest/jkqtplotter_simpletest.pro
|
||||
jkqtplotter_simpletest.depends = jkqtplotterlib
|
||||
|
||||
test_multiplot.file = examples/test_multiplot/test_multiplot.pro
|
||||
test_multiplot.depends = jkqtplotterlib
|
||||
|
||||
jkqtfastplotter_test.file = $$PWD/examples/jkqtfastplotter_test/jkqtfastplotter_test.pro
|
||||
jkqtfastplotter_test.depends = jkqtplotterlib
|
||||
|
||||
@ -64,6 +61,26 @@ addSimpleTest(parsedfunctionplot)
|
||||
addSimpleTest(functionplot)
|
||||
addSimpleTest(geometric)
|
||||
addSimpleTest(ui)
|
||||
addSimpleTest(boxplot)
|
||||
#addSimpleTest(imageplot_nodatastore)
|
||||
#addSimpleTest(rgbimageplot_opencv)
|
||||
#addSimpleTest(imageplot_opencv)
|
||||
|
||||
|
||||
|
||||
defineTest(addTest) {
|
||||
test_name = $$1
|
||||
SUBDIRS += test_$${test_name}
|
||||
|
||||
test_$${test_name}.file = examples/test_$${test_name}/test_$${test_name}.pro
|
||||
test_$${test_name}.depends = jkqtplotterlib
|
||||
|
||||
export (test_$${test_name}.file)
|
||||
export (test_$${test_name}.depends)
|
||||
|
||||
export (SUBDIRS)
|
||||
}
|
||||
|
||||
addTest(multiplot)
|
||||
addTest(distributionplot)
|
||||
|
||||
|
12
README.md
@ -1,11 +1,11 @@
|
||||
# JKQTPLotter - A Qt Plotting Library
|
||||
# JKQTPlotter - A Qt Plotting Library
|
||||
This is an extensive library of function/data plotter classes for Qt (>= 4.7, tested with Qt up to 5.11).
|
||||
|
||||
This software is licensed under the term of the [GNU Lesser General Public License 2.1
|
||||
(LGPL 2.1)](./LICENSE) or above.
|
||||
|
||||
## Main Features
|
||||
- 2D Plotter class (JKQTPLotter)
|
||||
- 2D Plotter class (JKQTPlotter)
|
||||
- high-quality plotting
|
||||
- no other dependencies than Qt >=4.7 (compatible with Qt 5.xx)
|
||||
- highly customizable axes/grids (linear/log, date/time, custom ticks ...)
|
||||
@ -36,13 +36,13 @@ This software is licensed under the term of the [GNU Lesser General Public Licen
|
||||
- can be easily extended by deriving a new graph from JKQTPPlotElement or JKQTPPlotObject
|
||||
- optional: OpenCV interface
|
||||
- extensive set of [Examples/Tutorials](./examples/README.md)
|
||||
- extensive doxygen-generated [Documentation](http://jkriege2.github.io/JKQTPLotter/index.html)
|
||||
- extensive doxygen-generated [Documentation](http://jkriege2.github.io/JKQTPlotter/index.html)
|
||||
|
||||
## [Documentation](http://jkriege2.github.io/JKQTPLotter/index.html)
|
||||
## [Documentation](http://jkriege2.github.io/JKQTPlotter/index.html)
|
||||
A Documentation (auto-)generated with [doxygen](http://www.doxygen.nl/) from the trunk source code can be found here:
|
||||
**[http://jkriege2.github.io/JKQTPLotter/index.html](http://jkriege2.github.io/JKQTPLotter/index.html)**
|
||||
**[http://jkriege2.github.io/JKQTPlotter/index.html](http://jkriege2.github.io/JKQTPlotter/index.html)**
|
||||
|
||||
Documentation is auto-generated after pushes by [Travis](https://travis-ci.org/jkriege2/JKQTPLotter): [![Build Status](https://travis-ci.org/jkriege2/JKQTPLotter.svg?branch=master)](https://travis-ci.org/jkriege2/JKQTPLotter)
|
||||
Documentation is auto-generated after pushes by [Travis](https://travis-ci.org/jkriege2/JKQTPlotter): [![Build Status](https://travis-ci.org/jkriege2/JKQTPlotter.svg?branch=master)](https://travis-ci.org/jkriege2/JKQTPlotter)
|
||||
|
||||
## [Examples](./examples/)
|
||||
There is a [large set of usage examples (with explanations for each) and tutorials](./examples/) in the folder [`./examples/`](./examples).
|
||||
|
@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# title of most generated pages and in a few other places.
|
||||
# The default value is: My Project.
|
||||
|
||||
PROJECT_NAME = JKQTPLotter
|
||||
PROJECT_NAME = JKQTPlotter
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
|
@ -12,53 +12,56 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
<table>
|
||||
<tr><th>Screenshot<th>Description<th>Notes
|
||||
<tr><td> \image html jkqtplotter_simpletest1_small.png
|
||||
<td> \subpage JKQTPLotterSimpleTest
|
||||
<td> \subpage JKQTPlotterSimpleTest
|
||||
<td> `JKQTPXYLineGraph` <br> C++-style QVector arrays of data
|
||||
<tr><td> \image html jkqtplotter_simpletest_speed_small.png
|
||||
<td> \subpage JKQTPLotterSpeedTest
|
||||
<td> \subpage JKQTPlotterSpeedTest
|
||||
<td> `JKQTPXYLineGraph` <br> external `std::array<double,N>` data, not owned by datastore <br> live-data, measure plotting speed <br> tipps to increas plotting speed
|
||||
<tr><td> \image html jkqtplotter_simpletest_symbols_and_styles_small.png
|
||||
<td> \subpage JKQTPLotterSymbolsAndStyles
|
||||
<td> \subpage JKQTPlotterSymbolsAndStyles
|
||||
<td> `JKQTPXYLineGraph` <br> C++ vector of data <br> setting line styles and symbol styles <br> automatic graph coloring
|
||||
<tr><td> \image html jkqtplotter_simpletest_stepplots_small.png
|
||||
<td> \subpage JKQTPLotterStepPlot
|
||||
<td> \subpage JKQTPlotterStepPlot
|
||||
<td> `JKQTPStepHorizontalGraph` (and `JKQTPXYLineGraph`) <br> C++ vector of data <br> different step modes, filled and line-only
|
||||
<tr><td> \image html jkqtplotter_simpletest_symbols_and_errors_small.png
|
||||
<td> \subpage JKQTPLotterSymbolsErrors
|
||||
<td> \subpage JKQTPlotterSymbolsErrors
|
||||
<td> `JKQTPXYLineErrorGraph` <br> C-style arrays of data
|
||||
<tr><td> \image html jkqtplotter_simpletest_errorbarstyles_small.png
|
||||
<td> \subpage JKQTPLotterErrorBarStyles
|
||||
<td> \subpage JKQTPlotterErrorBarStyles
|
||||
<td> `JKQTPXYLineErrorGraph` <br> different styles of error indicators for x- and y-errors <br> C++-style QVector for data <br> styling error indicators <br> moving key and formatting plotter grid
|
||||
<tr><td> \image html jkqtplotter_simpletest_barchart_small.png
|
||||
<td> \subpage JKQTPLotterBarcharts
|
||||
<td> \subpage JKQTPlotterBarcharts
|
||||
<td> `JKQTPBarVerticalGraph` <br> C-style arrays of data
|
||||
<tr><td> \image html JKQTPBarHorizontalGraphStacked_small.png
|
||||
<td> \subpage JKQTPLotterStackedBarChart
|
||||
<td> \subpage JKQTPlotterStackedBarChart
|
||||
<td> `JKQTPBarVerticalStackableGraph`, `JKQTPBarHorizontalStackableGraph` <br> C++-style vectors of data
|
||||
<tr><td> \image html jkqtplotter_simpletest_filledgraphs_small.png
|
||||
<td> \subpage JKQTPLotterFilledGraphs
|
||||
<td> \subpage JKQTPlotterFilledGraphs
|
||||
<td> `JKQTPBarVerticalGraph` <br> setting/altering data in `JKQTPDatstore` directly <br> transparent plots <br> calculating histograms
|
||||
<tr><td> \image html jkqtplotter_simpletest_impulsesplot_small.png
|
||||
<td> \subpage JKQTPLotterImpulsePlots
|
||||
<td> \subpage JKQTPlotterImpulsePlots
|
||||
<td> `JKQTPImpulsesVerticalGraph` and `JKQTPImpulsesHorizontalGraph` <br> C++-style QVector as plot data
|
||||
<tr><td> \image html jkqtplotter_simpletest_paramscatterplot_small.png
|
||||
<td> \subpage JKQTPLotterParamScatter
|
||||
<td> \subpage JKQTPlotterParamScatter
|
||||
<td> `JKQTPXYParametrizedScatterGraph` <br> C++-style QVector as plot data <br> modify scatter/points/line-graph properties by data
|
||||
<tr><td> \image html jkqtplotter_simpletest_paramscatterplot_image_small.png
|
||||
<td> \subpage JKQTPLotterParamScatterImage
|
||||
<td> \subpage JKQTPlotterParamScatterImage
|
||||
<td> `JKQTPXYParametrizedScatterGraph` <br> C++-style QVector as plot data <br> rectangular arrangement of scatters <br> generative computer graphics
|
||||
<tr><td> \image html jkqtplotter_simpletest_parametriccurve_small.png
|
||||
<td> \subpage JKQTPLotterParametricCurves
|
||||
<td> \subpage JKQTPlotterParametricCurves
|
||||
<td> `JKQTPXYLineGraph` and `JKQTPXYParametrizedScatterGraph` <br> C++-style QVector as plot data <br> parametric curve plotting
|
||||
<tr><td> \image html jkqtplotter_simpletest_functionplot_small.png
|
||||
<td> \subpage JKQTPLotterFunctionPlots
|
||||
<td> \subpage JKQTPlotterFunctionPlots
|
||||
<td> `JKQTPXFunctionLineGraph` <br> diretly plotting C/C++-functions
|
||||
<tr><td> \image html jkqtplotter_simpletest_parsedfunctionplot_small.png
|
||||
<td> \subpage JKQTPLotterParsedFunctionPlot
|
||||
<td> \subpage JKQTPlotterParsedFunctionPlot
|
||||
<td> `JKQTPXParsedFunctionLineGraph` <br> plotting functions with the internal math equation parser/evaluator
|
||||
<tr><td> \image html jkqtplotter_simpletest_geometric_small.png
|
||||
<td> \subpage JKQTPLotterGeometricGraphs
|
||||
<td> \subpage JKQTPlotterGeometricGraphs
|
||||
<td> `JKQTPPlotObject`, `JKQTPGeoArc`, `JKQTPGeoLine`, `JKQTPGeoRectangle`, ...
|
||||
<tr><td> \image html jkqtplotter_simpletest_boxplot_small.png
|
||||
<td> \subpage JKQTPlotterBoxplotsGraphs
|
||||
<td> `JKQTPBoxplotVerticalGraph`, `JKQTPBoxplotHorizontalGraph`, ...
|
||||
</table>
|
||||
|
||||
|
||||
@ -67,10 +70,10 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
<table>
|
||||
<tr><th> Screenshot <th> Description <th> Notes
|
||||
<tr><td> \image html jkqtplotter_simpletest_logaxes_small.png
|
||||
<td> \subpage JKQTPLotterLogAxes
|
||||
<td> \subpage JKQTPlotterLogAxes
|
||||
<td> `JKQTPXYLineGraph` and `JKQTPGeoText` <br> C++ vector of data <br> logarithmic axes and styling <br> plot line styles <br> internal LaTeX parser <br> add commenting text to a graph
|
||||
<tr><td> \image html jkqtplotter_simpletest_dateaxes_timeaxis_small.png
|
||||
<td> \subpage JKQTPLotterDateTimeAxes
|
||||
<td> \subpage JKQTPlotterDateTimeAxes
|
||||
<td> `JKQTPXYLineGraph` and `JKQTPFilledVerticalRangeGraph` <br> C++ vector of data <br> date/time axes <br> plot min/max range graph <br> internal LaTeX parser <br> data from CSV files
|
||||
</table>
|
||||
|
||||
@ -81,22 +84,22 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
<table>
|
||||
<tr><th> Screenshot <th> Description <th> Notes
|
||||
<tr><td> \image html jkqtplotter_simpletest_rgbimageplot_qt_small.png
|
||||
<td> \subpage JKQTPLotterImagePlotQImageRGB
|
||||
<td> \subpage JKQTPlotterImagePlotQImageRGB
|
||||
<td> `JKQTPImage` <br> `QImage` drawn onto a plot with arbitrary scaling)
|
||||
<tr><td> \image html jkqtplotter_simpletest_imageplot_small.png
|
||||
<td> \subpage JKQTPLotterImagePlot
|
||||
<td> \subpage JKQTPlotterImagePlot
|
||||
<td> `JKQTPColumnMathImage` <br> image data copied from C-style row-major array into a single column of the internal datastore <br> Describes several options of the image plotting classes (different ways of color coding, what to do with data above/below the limits etc.)
|
||||
<tr><td> \image html jkqtplotter_simpletest_imageplot_modifier_small.png
|
||||
<td> \subpage JKQTPLotterImagePlotModifier
|
||||
<td> \subpage JKQTPlotterImagePlotModifier
|
||||
<td> `JKQTPColumnMathImage` <br> image data copied from C-style row-major array into a single column of the internal datastore <br> Image is modified by a second image to display two data dimensions at the same time
|
||||
<tr><td> \image html jkqtplotter_simpletest_imageplot_nodatastore_small.png
|
||||
<td> \subpage JKQTPLotterImagePlotNoDatastore
|
||||
<td> \subpage JKQTPlotterImagePlotNoDatastore
|
||||
<td> `JKQTPMathImage` <br> image data in a C-style row-major array, not using internal datastore
|
||||
<tr><td> \image html jkqtplotter_simpletest_imageplot_opencv_small.png
|
||||
<td> \subpage JKQTPLotterImagePlotOpenCV
|
||||
<td> \subpage JKQTPlotterImagePlotOpenCV
|
||||
<td> `JKQTPColumnMathImage` <br> image data copied from OpenCV cv::Mat-structure into a single column of the internal datastore
|
||||
<tr><td> \image html jkqtplotter_simpletest_rgbimageplot_opencv_small.png
|
||||
<td> \subpage JKQTPLotterImagePlotRGBOpenCV
|
||||
<td> \subpage JKQTPlotterImagePlotRGBOpenCV
|
||||
<td> `JKQTPColumnRGBMathImage` <br> image data copied from OpenCV cv::Mat-structure into three columns of the internal datastore
|
||||
</table>
|
||||
|
||||
@ -107,11 +110,25 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
<table>
|
||||
<tr><th> Screenshot <th> Description <th> Notes
|
||||
<tr><td> \image html test_multiplot_small.png
|
||||
<td> \subpage JKQTPLotterMultiPlotLayout
|
||||
<td> \subpage JKQTPlotterMultiPlotLayout
|
||||
<td> Combining plots in Qt Layouts <br> linking plot axes <br> copy data from a `std::map` int the datastore <br> print plots/print preview
|
||||
<tr><td> \image html jkqtplotter_simpletest_ui_small.png
|
||||
<td> \subpage JKQTPLotterQtCreator
|
||||
<td> using Qt Form Designer <br> parsed function plots (`JKQTPXParsedFunctionLineGraph`) </table>
|
||||
<td> \subpage JKQTPlotterQtCreator
|
||||
<td> using Qt Form Designer <br> parsed function plots (`JKQTPXParsedFunctionLineGraph`)
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
\subsection jkqtp_extut_complexexamples More Complex Examples
|
||||
|
||||
<table>
|
||||
<tr><th> Screenshot <th> Description <th> Notes
|
||||
<tr><td> \image html test_multiplot_small.png
|
||||
<td> \subpage JKQTPlotterMultiPlotLayout
|
||||
<td> Combining plots in Qt Layouts <br> linking plot axes <br> copy data from a `std::map` int the datastore <br> print plots/print preview
|
||||
<tr><td> \image html test_distributionplot_small.png
|
||||
<td> \subpage JKQTPlotterDistributionPlot
|
||||
<td> Combines several different graphs to draw random values, their distribution and some statistical properties
|
||||
</table>
|
||||
|
||||
|
||||
@ -123,6 +140,9 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
<tr><td> \image html jkqtmathtext_simpletest_small.png
|
||||
<td> \subpage JKQTMathTextSimpleExample
|
||||
<td> JKQTMathText<br>render LaTeX markup (Schrödinger's equation)
|
||||
<tr><td> \image html jkqtmathtext_testapp_small.png
|
||||
<td> \subpage JKQTMathTextTestApp
|
||||
<td> JKQTMathText<br>render LaTeX markup
|
||||
</table>
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
\defgroup jkqtfastplotter JKQTFastPlotter: Speed-Optimized Plotter class
|
||||
|
||||
This is an indepent (and fully self-contained) plotter class, which is optimized for drawing speed, rather than
|
||||
output quality. It lacks several of the advanced features of JKQTPLotter, but can be used in cases, where fast
|
||||
output quality. It lacks several of the advanced features of JKQTPlotter, but can be used in cases, where fast
|
||||
update of plots or real-time plotting is required.
|
||||
|
||||
An example for the usage of this class can be found here: \link ../../examples/jkqtfastplotter_test \endlink
|
||||
|
@ -3,7 +3,7 @@
|
||||
\defgroup jkqtmathtext JKQTMathText LaTeX-Renderer for Qt
|
||||
|
||||
This group contains JKQTMathText, a self-contained LaTeX-renderer for Qt. It is used to renderer
|
||||
labels in JKQTPLotter, but can be used independently. The class does not depend on any library,
|
||||
labels in JKQTPlotter, but can be used independently. The class does not depend on any library,
|
||||
except Qt. In particular it actually parses a LaTeX string and draws it in pure C++. It does NOT rely
|
||||
on an installed LaTeX for the rendering!
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
|
||||
\defgroup jkqtptools Tool Functions and Definitions for JKQTPLotter
|
||||
\defgroup jkqtptools Tool Functions and Definitions for JKQTPlotter
|
||||
|
||||
This group contains a set of tools that I've written over the years to enhance the
|
||||
C++ standard library.
|
||||
@ -27,9 +27,9 @@ C++ standard library.
|
||||
|
||||
|
||||
|
||||
\defgroup jkqtplotter JKQTPLotter: Qt based Scientific Plotter Class
|
||||
\defgroup jkqtplotter JKQTPlotter: Qt based Scientific Plotter Class
|
||||
|
||||
A Qt based plotter for 2D scientific graphs. Main Plotting widget is JKQTPLotter.
|
||||
A Qt based plotter for 2D scientific graphs. Main Plotting widget is JKQTPlotter.
|
||||
|
||||
|
||||
\defgroup jkqtpdatastorage Data Storage Classes/System
|
||||
@ -44,11 +44,11 @@ classes.
|
||||
\defgroup jkqtpopencvinterface OpenCV Interfaceing Tools
|
||||
\ingroup jkqtpdatastorage
|
||||
|
||||
Classes and functions in this group allow JKQTPLotter to directly work with <a href="https://opencv.org/">OpenCV</a> data structures.
|
||||
Classes and functions in this group allow JKQTPlotter to directly work with <a href="https://opencv.org/">OpenCV</a> data structures.
|
||||
|
||||
Examples:
|
||||
- \ref JKQTPLotterImagePlotOpenCV
|
||||
- \ref JKQTPLotterImagePlotRGBOpenCV
|
||||
- \ref JKQTPlotterImagePlotOpenCV
|
||||
- \ref JKQTPlotterImagePlotRGBOpenCV
|
||||
.
|
||||
|
||||
\defgroup jkqtpplotterclasses Plotter Class & Plotter Widget
|
||||
@ -59,14 +59,14 @@ coordinate system management an actual plotter widget ...
|
||||
|
||||
There are two main classes:
|
||||
- JKQTBasePlotter is a QObject-derived class that implements all the plotting logic and drawing code. It does not implement a Qt widget though.
|
||||
- JKQTPLotter is a QWidget-based class that contains a JKQTBasePlotter and uses it to draw plots onto a Qt form.
|
||||
- JKQTPlotter is a QWidget-based class that contains a JKQTBasePlotter and uses it to draw plots onto a Qt form.
|
||||
.
|
||||
|
||||
|
||||
\defgroup jkqtplotter_elements Plot Elements
|
||||
\ingroup jkqtplotter
|
||||
|
||||
This group assembles all classes that represent different elements of a plot (managed by JKQTBasePlotter/JKQTPLotter).
|
||||
This group assembles all classes that represent different elements of a plot (managed by JKQTBasePlotter/JKQTPlotter).
|
||||
There are these major subgroups:
|
||||
- \ref jkqtpbaseplotter_elements contains all non-graph objects, i.e. things like coordinate axes and so on
|
||||
- \ref jkqtplotter_graphsgroup contains the actual graph classes
|
||||
@ -77,7 +77,7 @@ There are these major subgroups:
|
||||
\ingroup jkqtplotter_elements
|
||||
|
||||
This group contains some tool classes that implement basic elements of the plot (coordinate axes, key, ...).
|
||||
These classes are used by JKQTPLotterBase to output the plot
|
||||
These classes are used by JKQTPlotterBase to output the plot
|
||||
|
||||
|
||||
\defgroup jkqtplotter_graphsgroup Graph Classes
|
||||
@ -109,7 +109,7 @@ These classes are used by JKQTPLotterBase to output the plot
|
||||
\ingroup jkqtplotter_graphsgroup
|
||||
|
||||
Examples:
|
||||
- \ref JKQTPLotterGeometricGraphs
|
||||
- \ref JKQTPlotterGeometricGraphs
|
||||
.
|
||||
|
||||
\defgroup jkqtplotter_diverse Diverse Other Graphs (Ranges, ...)
|
||||
@ -133,17 +133,17 @@ Examples:
|
||||
|
||||
|
||||
|
||||
\defgroup jkqtpqtwidgetsttools Qt Widgets/Tools to work with JKQTPLotter
|
||||
\defgroup jkqtpqtwidgetsttools Qt Widgets/Tools to work with JKQTPlotter
|
||||
\ingroup jkqtplotter
|
||||
|
||||
This group assembles several Qt widgets and tool classes that are linked to JKQTPLotter/JKQTBasePlotter and allow to build advanced GUIs for these (e.g. model/view access to internal data ...)
|
||||
This group assembles several Qt widgets and tool classes that are linked to JKQTPlotter/JKQTBasePlotter and allow to build advanced GUIs for these (e.g. model/view access to internal data ...)
|
||||
|
||||
\defgroup jkqtpgraphsmodel Qt Data Models to Access Graphs in a JKQTBasePlotter/JKQTPLotter
|
||||
\defgroup jkqtpgraphsmodel Qt Data Models to Access Graphs in a JKQTBasePlotter/JKQTPlotter
|
||||
\ingroup jkqtpqtwidgetsttools
|
||||
|
||||
Data models in this group allow to access different internal data from a JKQTBasePlotter/JKQTPLotter and in part to manipulate these.
|
||||
Data models in this group allow to access different internal data from a JKQTBasePlotter/JKQTPlotter and in part to manipulate these.
|
||||
|
||||
\defgroup jkqtpcomboboxes Comboboxes for Properties of JKQTBasePlotter/JKQTPLotter
|
||||
\defgroup jkqtpcomboboxes Comboboxes for Properties of JKQTBasePlotter/JKQTPlotter
|
||||
\ingroup jkqtpqtwidgetsttools
|
||||
|
||||
This group contains several QComboBox-derived classes that can be used to select different enum-values (e.g. with JKQTPMathImageColorPaletteComboBox you can select a color-palette from JKQTPMathImageColorPalette ).
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
|
||||
\mainpage JKQTPLotter - A Qt Plotting Library
|
||||
\mainpage JKQTPlotter - A Qt Plotting Library
|
||||
This is an extensive library of function/data plotter classes for Qt (>= 4.7, tested with Qt up to 5.11).
|
||||
|
||||
This software is licensed under the term of the GNU Lesser General Public License 2.1
|
||||
@ -9,7 +9,7 @@ This software is licensed under the term of the GNU Lesser General Public Licens
|
||||
\image html examplesbanner.png
|
||||
|
||||
\section jkqtp_main_features Main Features
|
||||
- Extensive Scientific 2D Plotting framework (JKQTPLotter/JKQTBasePlotter)
|
||||
- Extensive Scientific 2D Plotting framework (JKQTPlotter/JKQTBasePlotter)
|
||||
- high-quality plotting
|
||||
- no other dependencies than Qt >=4.7 (compatible with Qt 5.xx)
|
||||
- highly customizable axes/grids (linear/log, date/time, custom ticks ...)
|
||||
@ -42,15 +42,15 @@ This software is licensed under the term of the GNU Lesser General Public Licens
|
||||
- integrated LaTeX parser/renderer JKQTMathText:
|
||||
- pure C++
|
||||
- no dependencies in particular no installed LaTeX required
|
||||
- can be used independently of JKQTPLotter
|
||||
- can be used independently of JKQTPlotter
|
||||
- see: \ref jkqtmathtext
|
||||
- a second plotter widget JKQTFastPlotter:
|
||||
- is optimized for fast plotting, but is not as feature-rich as JKQTPLotter
|
||||
- may be used independently of JKQTPLotter
|
||||
- is optimized for fast plotting, but is not as feature-rich as JKQTPlotter
|
||||
- may be used independently of JKQTPlotter
|
||||
- \see jkqtfastplotter
|
||||
- extensive set of Examples and Tutorials, see: \ref exampleTutorialProjects
|
||||
- extensive doxygen-generated <a href="http://jkriege2.github.io/JKQTPLotter/index.html">Online-Documentation (http://jkriege2.github.io/JKQTPLotter/index.html)</a>
|
||||
- source code hosted&developed on GitHub <a href="https://github.com/jkriege2/JKQTPLotter">https://github.com/jkriege2/JKQTPLotter</a> (including continuous integration builds: <a href="https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master">https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master</a>)
|
||||
- extensive doxygen-generated <a href="http://jkriege2.github.io/JKQTPlotter/index.html">Online-Documentation (http://jkriege2.github.io/JKQTPlotter/index.html)</a>
|
||||
- source code hosted&developed on GitHub <a href="https://github.com/jkriege2/JKQTPlotter">https://github.com/jkriege2/JKQTPlotter</a> (including continuous integration builds: <a href="https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master">https://ci.appveyor.com/project/jkriege2/jkqtplotter/branch/master</a>)
|
||||
|
||||
\image html screenshotsbanner.png
|
||||
|
||||
|
BIN
doc/images/JKQTPSingleColumnSymbolsGraph_BeeSwarmScatter.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
doc/images/JKQTPSingleColumnSymbolsGraph_NoScatter.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
doc/images/JKQTPSingleColumnSymbolsGraph_RandomScatter.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
doc/images/boxplot_outliers.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
doc/images/boxplots.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
doc/images/jkqtmathtext_array.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
doc/images/jkqtmathtext_bbmatrix.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
doc/images/jkqtmathtext_bmatrix.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
doc/images/jkqtmathtext_bold.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
doc/images/jkqtmathtext_boxed.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
doc/images/jkqtmathtext_brace_array.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
doc/images/jkqtmathtext_brace_begincases.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
doc/images/jkqtmathtext_brace_ceil.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
doc/images/jkqtmathtext_brace_curly.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
doc/images/jkqtmathtext_brace_dblline.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
doc/images/jkqtmathtext_brace_floor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
doc/images/jkqtmathtext_brace_frac.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
doc/images/jkqtmathtext_brace_oneline.png
Normal file
After Width: | Height: | Size: 1023 B |
BIN
doc/images/jkqtmathtext_brace_overbrace.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
doc/images/jkqtmathtext_brace_overset.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
doc/images/jkqtmathtext_brace_rect.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
doc/images/jkqtmathtext_brace_round.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
doc/images/jkqtmathtext_brace_stackrel.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
doc/images/jkqtmathtext_brace_tri.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
doc/images/jkqtmathtext_brace_underbrace.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
doc/images/jkqtmathtext_brace_underset.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
doc/images/jkqtmathtext_colorbox.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
doc/images/jkqtmathtext_colored.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
doc/images/jkqtmathtext_fonts.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
doc/images/jkqtmathtext_greek.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
doc/images/jkqtmathtext_italic.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
doc/images/jkqtmathtext_mathdeco.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
doc/images/jkqtmathtext_ol.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
doc/images/jkqtmathtext_pmatrix.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
doc/images/jkqtmathtext_sc.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
doc/images/jkqtmathtext_specialsubsuper.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
doc/images/jkqtmathtext_supersub.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
doc/images/jkqtmathtext_symbols.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
doc/images/jkqtmathtext_ul.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
doc/images/jkqtmathtext_verb.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
doc/images/jkqtmathtext_vmatrix.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
doc/images/jkqtmathtext_vvmatrix.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
@ -1,4 +1,4 @@
|
||||
# Example (JKQTPLotter): Examples & Tutorials {#exampleProjectsTutorials}
|
||||
# Example (JKQTPlotter): Examples & Tutorials {#exampleProjectsTutorials}
|
||||
This section assembles some simple examples of usage.
|
||||
You can find more (complex) examples for the classes in this repository in the subfolder "test".
|
||||
All test-projects are Qt-projects that use qmake to build. You can load them into QtCreator easily.
|
||||
@ -23,6 +23,7 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
| [![](../screenshots/jkqtplotter_simpletest_functionplot_small.png)](./simpletest_functionplot) | [Plotting Mathematical Functions as Line Graphs](./simpletest_functionplot) | `JKQTPXFunctionLineGraph` <br> diretly plotting C/C++-functions |
|
||||
| [![](../screenshots/jkqtplotter_simpletest_parsedfunctionplot_small.png)](./simpletest_parsedfunctionplot) | [Plotting Parsed Mathematical Functions as Line Graphs](./simpletest_parsedfunctionplot) | `JKQTPXParsedFunctionLineGraph` <br> plotting functions with the internal math equation parser/evaluator |
|
||||
| [![](../screenshots/jkqtplotter_simpletest_geometric_small.png)](./simpletest_geometric) | [Plotting Geometric Objects](./simpletest_geometric) | |
|
||||
| [![](../screenshots/jkqtplotter_simpletest_boxplot_small.png)](./simpletest_boxplot) | [Plotting Box Plots](./simpletest_boxplot) | `JKQTPBoxplotVerticalGraph`, `JKQTPBoxplotHorizontalGraph` |
|
||||
|
||||
## Styling the Plot, Keys, Axes, ...
|
||||
|
||||
@ -43,17 +44,31 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
|
||||
| [![](../screenshots/jkqtplotter_simpletest_imageplot_opencv_small.png)](./simpletest_imageplot_opencv) | [1-channel OpenCV cv::Mat Image Plot](./simpletest_imageplot_opencv) | `JKQTPColumnMathImage` <br> image data copied from OpenCV cv::Mat-structure into a single column of the internal datastore |
|
||||
| [![](../screenshots/jkqtplotter_simpletest_rgbimageplot_opencv_small.png)](./simpletest_rgbimageplot_opencv) | [RGB OpenCV cv::Mat Image Plot](./simpletest_rgbimageplot_opencv) | `JKQTPColumnRGBMathImage` <br> image data copied from OpenCV cv::Mat-structure into three columns of the internal datastore |
|
||||
|
||||
|
||||
|
||||
## GUI Tools and Plot Layout
|
||||
|
||||
| Screenshot | Description | Notes |
|
||||
|:-------------:| ------------- | ------------- |
|
||||
| [![](../screenshots/test_multiplot_small.png)](./test_multiplot) | [Layouting Several Plots](./test_multiplot) | Combining plots in Qt Layouts <br> linking plot axes <br> copy data from a `std::map` int the datastore <br> print plots/print preview |
|
||||
| [![](../screenshots/jkqtplotter_simpletest_ui_small.png)](./simpletest_ui) | [Placing JKQTPLotter into a Qt User-Interface-XML-file (`*.ui`)](./simpletest_ui) | using Qt Form Designer <br> parsed function plots (`JKQTPXParsedFunctionLineGraph`) |
|
||||
| [![](../screenshots/jkqtplotter_simpletest_ui_small.png)](./simpletest_ui) | [Placing JKQTPlotter into a Qt User-Interface-XML-file (`*.ui`)](./simpletest_ui) | using Qt Form Designer <br> parsed function plots (`JKQTPXParsedFunctionLineGraph`) |
|
||||
|
||||
|
||||
|
||||
## More Complex Examples
|
||||
|
||||
| Screenshot | Description | Notes |
|
||||
|:-------------:| ------------- | ------------- |
|
||||
| [![](../screenshots/test_multiplot_small.png)](./test_multiplot) | [Layouting Several Plots](./test_multiplot) | Combining plots in Qt Layouts <br> linking plot axes <br> copy data from a `std::map` int the datastore <br> print plots/print preview |
|
||||
| [![](../screenshots/test_distributionplot_small.png)](./test_distributionplot) | [Plotting a Statistical Distribution of Data](./test_distributionplot) | Combines several different graphs to draw random values, their distribution and some statistical properties |
|
||||
|
||||
|
||||
|
||||
## Tools and Special Features
|
||||
|
||||
| Screenshot | Description | Notes |
|
||||
|:-------------:| ------------- | ------------- |
|
||||
| [![](../screenshots/jkqtmathtext_simpletest_small.png)](./jkqtmathtext_simpletest) | [JKQTMathText: LaTeX Renderer](./jkqtmathtext_simpletest) | |
|
||||
| [![](../screenshots/jkqtmathtext_simpletest_small.png)](./jkqtmathtext_simpletest) | [JKQTMathText: Simple Demonstration](./jkqtmathtext_simpletest) | |
|
||||
| [![](../screenshots/jkqtmathtext_testapp_small.png)](./jkqtmathtext_test) | [JKQTMathText: Full Testing Application](./jkqtmathtext_test) | |
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@ DEFINES += DEBUG_TIMING
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
|
||||
# include JKQTPLotter library
|
||||
# include JKQTPlotter library
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
|
@ -18,7 +18,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
|
||||
TARGET = jkqtmathtext_simpletest
|
||||
```
|
||||
And the soruce code of the main application is (see [`jkqtmathtext_simpletest.cpp`](../jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp):
|
||||
And the source code of the main application is (see [`jkqtmathtext_simpletest.cpp`](../jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp):
|
||||
```.cpp
|
||||
#include <QApplication>
|
||||
#include <QLabel>
|
||||
|
10
examples/jkqtmathtext_test/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Example (JKQTMathText): A test application {#JKQTMathTextTestApp}
|
||||
JKQTMathText is a hand-written LaTeX-renderer for Qt (implemented in native C++, using Qt). It supports a large set of standard LaTeX markup and can render it to a QPainter.
|
||||
|
||||
This test program demonstrates its capabilites. There are several pre-formulated LaTeX expressions that can be drawn, or you can enter a user-defined expression.
|
||||
You can also set several properties of the rendering (fonts, font sizes, anti-aliasing, ...). You can also draw boxes around each part of the expression (this is mostly meant for development/debugging). In the lower-right you will see the LaTeX expression as a tree after parsing and you will get timing-values for the parsing and rendering and error output.
|
||||
|
||||
The application looks like this:
|
||||
|
||||
![jkqtmathtext_simpletest](../../screenshots/jkqtmathtext_testapp.png)
|
||||
|
@ -17,7 +17,7 @@ TestWidgetBarcharts::TestWidgetBarcharts(QWidget *parent) :
|
||||
QVBoxLayout* barchartLayout=new QVBoxLayout(this);
|
||||
setLayout(barchartLayout);
|
||||
resize(1000, 800);
|
||||
plotBarchart=new JKQTPLotter(true, this);
|
||||
plotBarchart=new JKQTPlotter(true, this);
|
||||
plotBarchart->set_doDrawing(false);
|
||||
plotBarchart->get_plotter()->set_plotLabel(tr("\\textbf{bar charts}"));
|
||||
plotBarchart->setObjectName("plotBarchart");
|
||||
@ -74,7 +74,7 @@ TestWidgetBarcharts::TestWidgetBarcharts(QWidget *parent) :
|
||||
|
||||
|
||||
|
||||
plotBarchart2=new JKQTPLotter(false, this, plotBarchart->getDatastore());
|
||||
plotBarchart2=new JKQTPlotter(false, this, plotBarchart->getDatastore());
|
||||
plotBarchart2->set_doDrawing(false);
|
||||
plotBarchart2->get_plotter()->set_plotLabel(tr("\\textbf{bar charts}"));
|
||||
plotBarchart2->setObjectName("plotBarchart2");
|
||||
|
@ -44,8 +44,8 @@ class TestWidgetBarcharts : public QWidget
|
||||
protected:
|
||||
|
||||
|
||||
JKQTPLotter* plotBarchart;
|
||||
JKQTPLotter* plotBarchart2;
|
||||
JKQTPlotter* plotBarchart;
|
||||
JKQTPlotter* plotBarchart2;
|
||||
QCheckBox* chkBarLog;
|
||||
QSpinBox* spinBarLabelAngel;
|
||||
QSpinBox* spinBarLabelAngel2;
|
||||
|
@ -16,14 +16,14 @@ TestWidgetContourPlots::TestWidgetContourPlots(QWidget *parent) :
|
||||
// contour plot
|
||||
QHBoxLayout* layoutContour=new QHBoxLayout(this);
|
||||
setLayout(layoutContour);
|
||||
JKQTPLotter* plotContour=new JKQTPLotter(true, this);
|
||||
JKQTPlotter* plotContour=new JKQTPlotter(true, this);
|
||||
plotContour->set_doDrawing(false);
|
||||
plotContour->get_plotter()->set_plotLabel(tr("\\textbf{hist contour plot}"));
|
||||
plotContour->setObjectName("contour");
|
||||
plotContour->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "contour/");
|
||||
layoutContour->addWidget(plotContour);
|
||||
|
||||
JKQTPLotter* plotDensity=new JKQTPLotter(true, this);
|
||||
JKQTPlotter* plotDensity=new JKQTPlotter(true, this);
|
||||
plotContour->set_doDrawing(false);
|
||||
plotContour->get_plotter()->set_plotLabel(tr("\\textbf{2D histogram plot with contours}"));
|
||||
plotDensity->get_plotter()->set_plotLabel(tr("\\textbf{2D histogram}"));
|
||||
|
@ -14,7 +14,7 @@ TestWidgetEmptyPlot::TestWidgetEmptyPlot(QWidget *parent) :
|
||||
|
||||
#define NEMPTY 500
|
||||
|
||||
JKQTPLotter* plotEmpty=new JKQTPLotter(true, this);
|
||||
JKQTPlotter* plotEmpty=new JKQTPlotter(true, this);
|
||||
JKQTPXYLineGraph* efunc=new JKQTPXYLineGraph(plotEmpty->get_plotter());
|
||||
double xef[NEMPTY], efy[NEMPTY];
|
||||
for (int i=0; i<NEMPTY; i++) {
|
||||
|
@ -16,7 +16,7 @@ TestWidgetFunctionPlots::TestWidgetFunctionPlots(QWidget *parent) :
|
||||
|
||||
QVBoxLayout* plotFuncLayout=new QVBoxLayout(this);
|
||||
setLayout(plotFuncLayout);
|
||||
plotFuncPlt=new JKQTPLotter(true, this);
|
||||
plotFuncPlt=new JKQTPlotter(true, this);
|
||||
plotFuncLayout->addWidget(plotFuncPlt);
|
||||
pfunc=new JKQTPXParsedFunctionLineGraph(plotFuncPlt->get_plotter());
|
||||
pfunc->set_function("x^2/10+sin(x*pi*10)");
|
||||
|
@ -47,7 +47,7 @@ class TestWidgetFunctionPlots : public QWidget
|
||||
protected:
|
||||
|
||||
JKQTPXParsedFunctionLineGraph* pfunc;
|
||||
JKQTPLotter* plotFuncPlt;
|
||||
JKQTPlotter* plotFuncPlt;
|
||||
JKQTPErrorPlotstyleComboBox* pfuncErrorStyle;
|
||||
QCheckBox* chkPFuncDrawSamples;
|
||||
QCheckBox* chkPFuncDrawLine;
|
||||
|
@ -15,7 +15,7 @@ TestWidgetGeometry::TestWidgetGeometry(QWidget *parent) :
|
||||
QVBoxLayout* layout1=new QVBoxLayout(this);
|
||||
setLayout(layout1);
|
||||
resize(1000, 800);
|
||||
JKQTPLotter* plotGeo=new JKQTPLotter(true, this);
|
||||
JKQTPlotter* plotGeo=new JKQTPlotter(true, this);
|
||||
plotGeo->set_doDrawing(false);
|
||||
plotGeo->setObjectName("plotGeo");
|
||||
layout1->addWidget(plotGeo);
|
||||
|
@ -19,10 +19,10 @@ TestWidgetGraphs::TestWidgetGraphs(QWidget *parent) :
|
||||
ovlTime.start();
|
||||
|
||||
|
||||
plot=new JKQTPLotter(true, this);
|
||||
plot=new JKQTPlotter(true, this);
|
||||
plot->set_doDrawing(false);
|
||||
plotBot=new JKQTPLotter(false, this, plot->getDatastore());
|
||||
plotBot2=new JKQTPLotter(false, this, plot->getDatastore());
|
||||
plotBot=new JKQTPlotter(false, this, plot->getDatastore());
|
||||
plotBot2=new JKQTPlotter(false, this, plot->getDatastore());
|
||||
ovl1=new JKQTPOverlayVerticalLine(0.0, tr("test"), plot->get_plotter());
|
||||
plot->get_plotter()->addOverlayElement(ovl1);
|
||||
plot->setObjectName("plot");
|
||||
@ -48,7 +48,7 @@ TestWidgetGraphs::TestWidgetGraphs(QWidget *parent) :
|
||||
resize(1000, 800);
|
||||
|
||||
plotBot->synchronizeToMaster(plot, true, false);
|
||||
connect(plot, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTPLotter*)), plotBot, SLOT(synchronizeXAxis(double,double,double,double,JKQTPLotter*)));
|
||||
connect(plot, SIGNAL(zoomChangedLocally(double,double,double,double,JKQTPlotter*)), plotBot, SLOT(synchronizeXAxis(double,double,double,double,JKQTPlotter*)));
|
||||
plot->get_plotter()->set_gridPrinting(true);
|
||||
plot->get_plotter()->addGridPrintingPlotter(0,1,plotBot->get_plotter());
|
||||
plot->get_plotter()->addGridPrintingPlotter(0,2,plotBot2->get_plotter());
|
||||
|
@ -54,10 +54,10 @@ class TestWidgetGraphs : public QWidget
|
||||
|
||||
|
||||
JKQTPOverlayVerticalLine* ovl1;
|
||||
JKQTPLotter* plot;
|
||||
JKQTPLotter* plotLOG;
|
||||
JKQTPLotter* plotBot;
|
||||
JKQTPLotter* plotBot2;
|
||||
JKQTPlotter* plot;
|
||||
JKQTPlotter* plotLOG;
|
||||
JKQTPlotter* plotBot;
|
||||
JKQTPlotter* plotBot2;
|
||||
|
||||
JKQTPPlotElement* plteErrors;
|
||||
JKQTPPlotElement* plteSymbols;
|
||||
|
@ -19,7 +19,7 @@ TestWidgetImages::TestWidgetImages(QWidget *parent) :
|
||||
layouti->addLayout(layWid);
|
||||
setLayout(layouti);
|
||||
resize(1000, 800);
|
||||
plotImg=new JKQTPLotter(true, this);
|
||||
plotImg=new JKQTPlotter(true, this);
|
||||
plotImg->set_doDrawing(false);
|
||||
plotImg->get_plotter()->set_plotLabel(tr("\\textbf{image plot}"));
|
||||
plotImg->setObjectName("plotImg");
|
||||
|
@ -47,7 +47,7 @@ class TestWidgetImages : public QWidget
|
||||
|
||||
JKQTPMathImage* pimg2;
|
||||
JKQTPMathImage* pimg3;
|
||||
JKQTPLotter* plotImg;
|
||||
JKQTPlotter* plotImg;
|
||||
|
||||
|
||||
};
|
||||
|
@ -13,7 +13,7 @@ TestWidgetLogGraphs::TestWidgetLogGraphs(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
|
||||
JKQTPLotter* plotLOG=new JKQTPLotter(this);
|
||||
JKQTPlotter* plotLOG=new JKQTPlotter(this);
|
||||
plotLOG->set_doDrawing(false);
|
||||
plotLOG->setObjectName("plotLOG");
|
||||
plotLOG->get_plotter()->set_userSettigsFilename(QApplication::applicationDirPath()+"/usersettings.ini", "plotLOG/");
|
||||
|
@ -17,7 +17,7 @@ TestWidgetParamScatterPlots::TestWidgetParamScatterPlots(QWidget *parent) :
|
||||
|
||||
setLayout(layoutPSP);
|
||||
resize(1000, 800);
|
||||
plotPSP=new JKQTPLotter(true, this);
|
||||
plotPSP=new JKQTPlotter(true, this);
|
||||
plotPSP->set_doDrawing(false);
|
||||
plotPSP->get_plotter()->set_plotLabel(tr("\\textbf{parametrized scatter plots}"));
|
||||
plotPSP->setObjectName("plotPSP");
|
||||
|
@ -40,7 +40,7 @@ class TestWidgetParamScatterPlots : public QWidget
|
||||
|
||||
protected:
|
||||
|
||||
JKQTPLotter* plotPSP;
|
||||
JKQTPlotter* plotPSP;
|
||||
JKQTPXYParametrizedErrorScatterGraph* pltePSPCol;
|
||||
JKQTPXYParametrizedScatterGraph* pltePSPSize;
|
||||
JKQTPXYParametrizedScatterGraph* pltePSPSymb;
|
||||
|
@ -18,7 +18,7 @@ TestWidgetPeaksPlots::TestWidgetPeaksPlots(QWidget *parent) :
|
||||
QVBoxLayout* layoutpeaks=new QVBoxLayout(this);
|
||||
setLayout(layoutpeaks);
|
||||
resize(1000, 800);
|
||||
plotPeaks=new JKQTPLotter(true, this);
|
||||
plotPeaks=new JKQTPlotter(true, this);
|
||||
plotPeaks->set_doDrawing(false);
|
||||
plotPeaks->get_plotter()->set_plotLabel(tr("\\textbf{peaks stream plot}"));
|
||||
plotPeaks->setObjectName("plotPeaks");
|
||||
|
@ -34,7 +34,7 @@ class TestWidgetPeaksPlots : public QWidget
|
||||
|
||||
protected:
|
||||
|
||||
JKQTPLotter* plotPeaks;
|
||||
JKQTPlotter* plotPeaks;
|
||||
JKQTPPeakStreamGraph* graphPeakStream1;
|
||||
JKQTPPeakStreamGraph* graphPeakStream2;
|
||||
|
||||
|
@ -19,7 +19,7 @@ TestWidgetRGBImages::TestWidgetRGBImages(QWidget *parent) :
|
||||
QFormLayout* frm=new QFormLayout(nullptr);
|
||||
winrgb->setLayout(layoutrgb);
|
||||
winrgb->resize(1000, 800);
|
||||
plotImgRGB=new JKQTPLotter(true, winrgb);
|
||||
plotImgRGB=new JKQTPlotter(true, winrgb);
|
||||
plotImgRGB->set_doDrawing(false);
|
||||
plotImgRGB->get_plotter()->set_plotLabel(tr("\\textbf{RGB image plot}"));
|
||||
plotImgRGB->setObjectName("plotImgRGB");
|
||||
|
@ -54,7 +54,7 @@ class TestWidgetRGBImages : public QWidget
|
||||
int rgb_colr, rgb_colb, rgb_colg, rgb_cola;
|
||||
|
||||
|
||||
JKQTPLotter* plotImgRGB;
|
||||
JKQTPlotter* plotImgRGB;
|
||||
JKQTPRGBMathImage* rgbimg;
|
||||
JKQTPColumnRGBMathImage* rgbimg2;
|
||||
|
||||
|
@ -58,7 +58,7 @@ QT += core gui xml svg
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
|
||||
|
||||
# include JKQTPLotter source code
|
||||
# include JKQTPlotter source code
|
||||
DEPENDPATH += $$PWD
|
||||
#$$PWD/../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Example (JKQTPLotter): Very simple line-graph {#JKQTPLotterSimpleTest}
|
||||
This project (see `./examples/simpletest/`) simply creates a JKQTPLotter widget (as a new window) and adds a single line-graph (a sine-wave). Data is initialized from two QVector<double> objects.
|
||||
# Example (JKQTPlotter): Very simple line-graph {#JKQTPlotterSimpleTest}
|
||||
This project (see `./examples/simpletest/`) simply creates a JKQTPlotter widget (as a new window) and adds a single line-graph (a sine-wave). Data is initialized from two QVector<double> objects.
|
||||
The QMake project looks like this (see [`jkqtplotter_simpletest.pro`](../simpletest/jkqtplotter_simpletest.pro):
|
||||
```.qmake
|
||||
# source code for this simple demo
|
||||
@ -13,7 +13,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
# output executable name
|
||||
TARGET = jkqtplotter_simpletest
|
||||
|
||||
# include JKQTPLotter source headers and link against library
|
||||
# include JKQTPlotter source headers and link against library
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
@ -23,7 +23,7 @@ CONFIG (debug, debug|release) {
|
||||
}
|
||||
```
|
||||
|
||||
Alternatively to linking agains a `libjkqtplotter`, you can also directy add the JKQTPLotter sources to the project:
|
||||
Alternatively to linking agains a `libjkqtplotter`, you can also directy add the JKQTPlotter sources to the project:
|
||||
```.qmake
|
||||
# source code for this simple demo
|
||||
SOURCES = jkqtplotter_simpletest.cpp
|
||||
@ -36,10 +36,10 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
# output executable name
|
||||
TARGET = jkqtplotter_simpletest
|
||||
|
||||
# include JKQTPLotter source code
|
||||
# include JKQTPlotter source code
|
||||
include(../../lib/jkqtplotter.pri)
|
||||
```
|
||||
The soruce code of the main application is (see [`jkqtplotter_simpletest.cpp`](../simpletest/jkqtplotter_simpletest.cpp):
|
||||
The source code of the main application is (see [`jkqtplotter_simpletest.cpp`](../simpletest/jkqtplotter_simpletest.cpp):
|
||||
```.cpp
|
||||
#include <QApplication>
|
||||
#include "jkqtplotter/jkqtplotter.h"
|
||||
@ -51,7 +51,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
// 1. create a plotter window and get a pointer to the internal datastore
|
||||
// (for convenience)
|
||||
JKQTPLotter plot;
|
||||
JKQTPlotter plot;
|
||||
JKQTPDatastore* ds=plot.getDatastore();
|
||||
|
||||
// 2. now we create data for a simple plot (a sine curve)
|
||||
@ -63,7 +63,7 @@ int main(int argc, char* argv[])
|
||||
Y<<sin(x);
|
||||
}
|
||||
|
||||
// 3. make data available to JKQTPLotter by adding it to the internal
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal
|
||||
// datastore.
|
||||
// Note: In this step the data is copied (of not specified otherwise), so
|
||||
// you can reuse X and Y afterwards!
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** \example jkqtplotter_simpletest.cpp
|
||||
* A very basic example for the usage of JKQTPLotter
|
||||
* A very basic example for the usage of JKQTPlotter
|
||||
*
|
||||
* \ref JKQTPLotterSimpleTest
|
||||
* \ref JKQTPlotterSimpleTest
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
@ -14,7 +14,7 @@ int main(int argc, char* argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPLotter plot;
|
||||
JKQTPlotter plot;
|
||||
JKQTPDatastore* ds=plot.getDatastore();
|
||||
|
||||
// 2. now we create data for a simple plot (a sine curve)
|
||||
@ -26,7 +26,7 @@ int main(int argc, char* argv[])
|
||||
Y<<sin(x);
|
||||
}
|
||||
|
||||
// 3. make data available to JKQTPLotter by adding it to the internal datastore.
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
// Note: In this step the data is copied (of not specified otherwise), so you can
|
||||
// reuse X and Y afterwards!
|
||||
// the variables columnX and columnY will contain the internal column ID of the newly
|
||||
|
@ -9,7 +9,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
# output executable name
|
||||
TARGET = jkqtplotter_simpletest
|
||||
|
||||
# include JKQTPLotter source headers and link against library
|
||||
# include JKQTPlotter source headers and link against library
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Example (JKQTPLotter): Simple barchart {#JKQTPLotterBarcharts}
|
||||
This project (see [`simpletest_barchart`](../simpletest_barchart) simply creates a JKQTPLotter widget (as a new window) and adds several barcharts. They are ordered in groups.
|
||||
# Example (JKQTPlotter): Simple barchart {#JKQTPlotterBarcharts}
|
||||
This project (see [`simpletest_barchart`](../simpletest_barchart) simply creates a JKQTPlotter widget (as a new window) and adds several barcharts. They are ordered in groups.
|
||||
|
||||
The soruce code of the main application is (see [`jkqtplotter_simpletest_barchart.cpp`](../simpletest_barchart/jkqtplotter_simpletest_barchart.cpp):
|
||||
The source code of the main application is (see [`jkqtplotter_simpletest_barchart.cpp`](../simpletest_barchart/jkqtplotter_simpletest_barchart.cpp):
|
||||
```.cpp
|
||||
#include <QApplication>
|
||||
#include "jkqtplotter/jkqtplotter.h"
|
||||
@ -13,7 +13,7 @@ int main(int argc, char* argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPLotter plot;
|
||||
JKQTPlotter plot;
|
||||
plot.get_plotter()->set_useAntiAliasingForGraphs(true); // nicer (but slower) plotting
|
||||
plot.get_plotter()->set_useAntiAliasingForSystem(true); // nicer (but slower) plotting
|
||||
plot.get_plotter()->set_useAntiAliasingForText(true); // nicer (but slower) text rendering
|
||||
@ -26,7 +26,7 @@ int main(int argc, char* argv[])
|
||||
double Y2[Ndata]={ -5, -3, 1, 3, 6};
|
||||
double Y3[Ndata]={ 6, 2, 5, 3, 6};
|
||||
|
||||
// 3. make data available to JKQTPLotter by adding it to the internal datastore.
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
// Note: In this step the data is copied (of not specified otherwise)
|
||||
// the variables columnX and columnY... will contain the internal column ID of the
|
||||
// newly created columns with names "x" and "y..." and the (copied) data from X
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** \example jkqtplotter_simpletest_barchart.cpp
|
||||
* Shows how to draw Barcharts with JKQTPLotter
|
||||
* Shows how to draw Barcharts with JKQTPlotter
|
||||
*
|
||||
* \ref JKQTPLotterBarcharts
|
||||
* \ref JKQTPlotterBarcharts
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
@ -15,7 +15,7 @@ int main(int argc, char* argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPLotter plot;
|
||||
JKQTPlotter plot;
|
||||
plot.get_plotter()->set_useAntiAliasingForGraphs(true); // nicer (but slower) plotting
|
||||
plot.get_plotter()->set_useAntiAliasingForSystem(true); // nicer (but slower) plotting
|
||||
plot.get_plotter()->set_useAntiAliasingForText(true); // nicer (but slower) text rendering
|
||||
@ -30,7 +30,7 @@ int main(int argc, char* argv[])
|
||||
double Y2[Ndata]={ -5, -3, 1, 3, 6};
|
||||
double Y3[Ndata]={ 6, 2, 5, 3, 6};
|
||||
|
||||
// 3. make data available to JKQTPLotter by adding it to the internal datastore.
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
// Note: In this step the data is copied (of not specified otherwise)
|
||||
// the variables columnX and columnY... will contain the internal column ID of the
|
||||
// newly created columns with names "x" and "y..." and the (copied) data from X
|
||||
|
@ -9,7 +9,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
# output executable name
|
||||
TARGET = jkqtplotter_simpletest_barchart
|
||||
|
||||
# include JKQTPLotter source code
|
||||
# include JKQTPlotter source code
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
|
88
examples/simpletest_boxplot/README.md
Normal file
@ -0,0 +1,88 @@
|
||||
# Example (JKQTPlotter): Boxplots {#JKQTPlotterBoxplotsGraphs}
|
||||
This project (see [`simpletest_boxplot`](../simpletest_boxplot) demonstrates how to use JKQTPlotter to draw <a href="https://en.wikipedia.org/wiki/Box_plot">box plots</a> using the classes `JKQTPBoxplotVerticalGraph` and `JKQTPBoxplotHorizontalGraph`.
|
||||
|
||||
The source code of the main application is (see [`jkqtplotter_simpletest_boxplot.cpp`](jkqtplotter_simpletest_boxplot.cpp).
|
||||
|
||||
After adding all necessary data to the JKQTDatastore:
|
||||
```.cpp
|
||||
// 2. now we create data for the boxplots
|
||||
QVector<double> POS, POSY, MEDIAN, MEAN, Q25, Q75, MIN, MAX;
|
||||
POS << 1 << 4 << 7 << 10;
|
||||
POSY << -1 << -2 << -3 << -4;
|
||||
MIN << 2 << 3 << 2.5 << 6;
|
||||
Q25 << 4 << 4.5 << 5 << 7;
|
||||
MEDIAN << 5 << 6 << 7 << 9;
|
||||
MEAN << 5.5 << 5.2 << 8 << 8;
|
||||
Q75 << 6 << 7 << 9 << 11;
|
||||
MAX << 8 << 7.5 << 11 << 12;
|
||||
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
size_t columnPOS=ds->addCopiedColumn(POS, "POS");
|
||||
size_t columnPOSY=ds->addCopiedColumn(POSY, "POSY");
|
||||
size_t columnMIN=ds->addCopiedColumn(MIN, "MIN");
|
||||
size_t columnQ25=ds->addCopiedColumn(Q25, "Q25");
|
||||
size_t columnMEDIAN=ds->addCopiedColumn(MEDIAN, "MEDIAN");
|
||||
size_t columnMEAN=ds->addCopiedColumn(MEAN, "MEAN");
|
||||
size_t columnQ75=ds->addCopiedColumn(Q75, "Q75");
|
||||
size_t columnMAX=ds->addCopiedColumn(MAX, "MAX");
|
||||
```
|
||||
|
||||
... you can generate the JKQTPBoxplotVerticalGraph:
|
||||
|
||||
```.cpp
|
||||
// 4. create a graph of vertical boxplots:
|
||||
JKQTPBoxplotVerticalGraph* graph=new JKQTPBoxplotVerticalGraph(&plot);
|
||||
graph->set_posColumn(columnPOS);
|
||||
graph->set_minColumn(columnMIN);
|
||||
graph->set_percentile25Column(columnQ25);
|
||||
graph->set_medianColumn(columnMEDIAN);
|
||||
graph->set_meanColumn(columnMEAN);
|
||||
graph->set_percentile75Column(columnQ75);
|
||||
graph->set_maxColumn(columnMAX);
|
||||
graph->set_title("vertical Boxplots");
|
||||
```
|
||||
|
||||
You can further style the plot by e.g. setting:
|
||||
|
||||
```.cpp
|
||||
// 4.1 make fill collor a lighter shade of the outline color
|
||||
graph->set_fillColor(graphh->get_color().lighter());
|
||||
// 4.2 make whiskers dashed
|
||||
graph->set_whiskerStyle(Qt::DashLine);
|
||||
// 4.3 change mean symbol
|
||||
graph->set_meanSymbol(JKQTPstar);
|
||||
```
|
||||
|
||||
The result looks like this:
|
||||
|
||||
![jkqtplotter_simpletest_boxplot](../../screenshots/jkqtplotter_simpletest_boxplot.png)
|
||||
|
||||
In addition to the simple box plots, the image above also shows outliers as small circles. these need to be drawn with a separate `JKQTPXYLineGraph`:
|
||||
|
||||
```.cpp
|
||||
// add some outliers (as (x,y)-pairs)
|
||||
QVector<double> OUTLIERSX, OUTLIERSY;
|
||||
OUTLIERSX << 4 << 4 << 4 << 4 << 4 << 10 << 10 << 10 << 10 << 10 << 10 << 10;
|
||||
OUTLIERSY << 1 << 0.5 << 1.3 << 8 << 8.1 << 5 << 4 << 12.2 << 13 << 12.5 << 13.5 << 13.1;
|
||||
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
...
|
||||
size_t columnOUTLIERSX=ds->addCopiedColumn(OUTLIERSX, "OUTLIERSX");
|
||||
size_t columnOUTLIERSY=ds->addCopiedColumn(OUTLIERSY, "OUTLIERSY");
|
||||
|
||||
// 4. create a graph of vertical boxplots:
|
||||
...
|
||||
|
||||
// 5. outliers need to be drawn separately
|
||||
JKQTPXYLineGraph* graphOutliers=new JKQTPXYLineGraph(&plot);
|
||||
graphOutliers->set_xColumn(columnOUTLIERSX);
|
||||
graphOutliers->set_yColumn(columnOUTLIERSY);
|
||||
graphOutliers->set_title("outliers");
|
||||
// make the color a darker shade of the color of graph
|
||||
graphOutliers->set_color(graph->get_color().darker());
|
||||
graphOutliers->set_fillColor(QColor("white"));
|
||||
// draw outliers as small circles, without lines
|
||||
graphOutliers->set_symbol(JKQTPCircle);
|
||||
graphOutliers->set_drawLine(false);
|
||||
graphOutliers->set_symbolSize(7);
|
||||
```
|
108
examples/simpletest_boxplot/jkqtplotter_simpletest_boxplot.cpp
Normal file
@ -0,0 +1,108 @@
|
||||
/** \example jkqtplotter_simpletest_boxplot.cpp
|
||||
* Shows how to draw Boxplots with JKQTPlotter
|
||||
*
|
||||
* \ref JKQTPlotterBoxplotsGraphs
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include "jkqtplotter/jkqtplotter.h"
|
||||
#include "jkqtplotter/jkqtpgraphs.h"
|
||||
#include "jkqtplotter/jkqtpgraphsboxplot.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPlotter plot;
|
||||
plot.get_plotter()->set_useAntiAliasingForGraphs(true); // nicer (but slower) plotting
|
||||
plot.get_plotter()->set_useAntiAliasingForSystem(true); // nicer (but slower) plotting
|
||||
plot.get_plotter()->set_useAntiAliasingForText(true); // nicer (but slower) text rendering
|
||||
JKQTPDatastore* ds=plot.getDatastore();
|
||||
|
||||
// 2. now we create data for the boxplots
|
||||
QVector<double> POS, POSY, MEDIAN, MEAN, Q25, Q75, MIN, MAX, OUTLIERSX, OUTLIERSY;
|
||||
POS << 1 << 4 << 7 << 10;
|
||||
POSY << -1 << -2 << -3 << -4;
|
||||
MIN << 2 << 3 << 2.5 << 6;
|
||||
Q25 << 4 << 4.5 << 5 << 7;
|
||||
MEDIAN << 5 << 6 << 7 << 9;
|
||||
MEAN << 5.5 << 5.2 << 8 << 8;
|
||||
Q75 << 6 << 7 << 9 << 11;
|
||||
MAX << 8 << 7.5 << 11 << 12;
|
||||
// ... and some outliers (as (x,y)-pairs)
|
||||
OUTLIERSX << 4 << 4 << 4 << 4 << 4 << 10 << 10 << 10 << 10 << 10 << 10 << 10;
|
||||
OUTLIERSY << 1 << 0.5 << 1.3 << 8 << 8.1 << 5 << 4 << 12.2 << 13 << 12.5 << 13.5 << 13.1;
|
||||
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
size_t columnPOS=ds->addCopiedColumn(POS, "POS");
|
||||
size_t columnPOSY=ds->addCopiedColumn(POSY, "POSY");
|
||||
size_t columnMIN=ds->addCopiedColumn(MIN, "MIN");
|
||||
size_t columnQ25=ds->addCopiedColumn(Q25, "Q25");
|
||||
size_t columnMEDIAN=ds->addCopiedColumn(MEDIAN, "MEDIAN");
|
||||
size_t columnMEAN=ds->addCopiedColumn(MEAN, "MEAN");
|
||||
size_t columnQ75=ds->addCopiedColumn(Q75, "Q75");
|
||||
size_t columnMAX=ds->addCopiedColumn(MAX, "MAX");
|
||||
size_t columnOUTLIERSX=ds->addCopiedColumn(OUTLIERSX, "OUTLIERSX");
|
||||
size_t columnOUTLIERSY=ds->addCopiedColumn(OUTLIERSY, "OUTLIERSY");
|
||||
|
||||
// 4. create a graph of vertical boxplots:
|
||||
JKQTPBoxplotVerticalGraph* graph=new JKQTPBoxplotVerticalGraph(&plot);
|
||||
graph->set_posColumn(columnPOS);
|
||||
graph->set_minColumn(columnMIN);
|
||||
graph->set_percentile25Column(columnQ25);
|
||||
graph->set_medianColumn(columnMEDIAN);
|
||||
graph->set_meanColumn(columnMEAN);
|
||||
graph->set_percentile75Column(columnQ75);
|
||||
graph->set_maxColumn(columnMAX);
|
||||
graph->set_title("vertical Boxplots");
|
||||
|
||||
// 5. outliers need to be drawn separately
|
||||
JKQTPXYLineGraph* graphOutliers=new JKQTPXYLineGraph(&plot);
|
||||
graphOutliers->set_xColumn(columnOUTLIERSX);
|
||||
graphOutliers->set_yColumn(columnOUTLIERSY);
|
||||
graphOutliers->set_title("outliers");
|
||||
// make the color a darker shade of the color of graph
|
||||
graphOutliers->set_color(graph->get_color().darker());
|
||||
graphOutliers->set_fillColor(QColor("white"));
|
||||
// draw outliers as small circles, without lines
|
||||
graphOutliers->set_symbol(JKQTPCircle);
|
||||
graphOutliers->set_drawLine(false);
|
||||
graphOutliers->set_symbolSize(7);
|
||||
|
||||
// 6. create a graph of horizontal boxplots:
|
||||
JKQTPBoxplotHorizontalGraph* graphh=new JKQTPBoxplotHorizontalGraph(&plot);
|
||||
graphh->set_posColumn(columnPOSY);
|
||||
graphh->set_minColumn(columnMIN);
|
||||
graphh->set_percentile25Column(columnQ25);
|
||||
graphh->set_medianColumn(columnMEDIAN);
|
||||
graphh->set_meanColumn(columnMEAN);
|
||||
graphh->set_percentile75Column(columnQ75);
|
||||
graphh->set_maxColumn(columnMAX);
|
||||
graphh->set_title("horizontal Boxplots");
|
||||
// 6.1 make fill collor a lighter shade of the outline color
|
||||
graphh->set_fillColor(graphh->get_color().lighter());
|
||||
// 6.2 make whiskers dashed
|
||||
graphh->set_whiskerStyle(Qt::DashLine);
|
||||
// 6.3 change mean symbol
|
||||
graphh->set_meanSymbol(JKQTPstar);
|
||||
|
||||
|
||||
// 7. add the graphs to the plot, so it is actually displayed
|
||||
plot.addGraph(graph);
|
||||
plot.addGraph(graphOutliers);
|
||||
plot.addGraph(graphh);
|
||||
|
||||
|
||||
// 8. autoscale the plot so the graph is contained
|
||||
plot.zoomToFit();
|
||||
|
||||
// 9. Move key to top-left
|
||||
plot.get_plotter()->set_keyPosition(JKQTPKeyInsideTopLeft);
|
||||
|
||||
// show plotter and make it a decent size
|
||||
plot.show();
|
||||
plot.resize(800,800);
|
||||
|
||||
return app.exec();
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
# source code for this simple demo
|
||||
SOURCES = jkqtplotter_simpletest_boxplot.cpp
|
||||
|
||||
# configure Qt
|
||||
CONFIG += qt
|
||||
QT += core gui xml svg
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
|
||||
# output executable name
|
||||
TARGET = jkqtplotter_simpletest_boxplot
|
||||
|
||||
# include JKQTPlotter source code
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
LIBS += -L../../staticlib/debug -ljkqtplotterlib_debug
|
||||
} else {
|
||||
LIBS += -L../../staticlib/release -ljkqtplotterlib
|
||||
}
|
||||
message("LIBS = $$LIBS")
|
||||
|
||||
|
||||
# here you can activate some debug options
|
||||
#DEFINES += SHOW_JKQTPLOTTER_DEBUG
|
||||
#DEFINES += JKQTBP_AUTOTIMER
|
@ -0,0 +1,8 @@
|
||||
TEMPLATE = subdirs
|
||||
|
||||
SUBDIRS += jkqtplotterlib jkqtplotter_simpletest_boxplot
|
||||
|
||||
jkqtplotterlib.file = ../../staticlib/jkqtplotterlib.pro
|
||||
|
||||
jkqtplotter_simpletest_boxplot.file=$$PWD/jkqtplotter_simpletest_boxplot.pro
|
||||
jkqtplotter_simpletest_boxplot.depends = jkqtplotterlib
|
@ -1,7 +1,7 @@
|
||||
# Example (JKQTPLotter): Date/Time Axes {#JKQTPLotterDateTimeAxes}
|
||||
# Example (JKQTPlotter): Date/Time Axes {#JKQTPlotterDateTimeAxes}
|
||||
|
||||
## Date Axis
|
||||
This project (see `./examples/simpletest_dateaxes/`) simply creates a JKQTPLotter widget (as a new window) with the X-axis showing time or date(-time) values, formated as such.
|
||||
This project (see `./examples/simpletest_dateaxes/`) simply creates a JKQTPlotter widget (as a new window) with the X-axis showing time or date(-time) values, formated as such.
|
||||
|
||||
The source code of the main application can be found in [`jkqtplotter_simpletest_dateaxes.cpp`](../simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.cpp).
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** \example jkqtplotter_simpletest_dateaxes.cpp
|
||||
* Shows how to use date/time axes with JKQTPLotter
|
||||
* Shows how to use date/time axes with JKQTPlotter
|
||||
*
|
||||
* \ref JKQTPLotterDateTimeAxes
|
||||
* \ref JKQTPlotterDateTimeAxes
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
@ -15,7 +15,7 @@
|
||||
#include "jkqtplottertools/jkqtptools.h"
|
||||
#include "jkqtplotter/jkqtpgraphsfilledcurve.h"
|
||||
|
||||
void drawWithDateAxis(JKQTPLotter& plot) {
|
||||
void drawWithDateAxis(JKQTPlotter& plot) {
|
||||
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPDatastore* ds=plot.getDatastore();
|
||||
@ -98,7 +98,7 @@ void drawWithDateAxis(JKQTPLotter& plot) {
|
||||
plot.setWindowTitle("Date Axis");
|
||||
}
|
||||
|
||||
void drawWithTimeAxis(JKQTPLotter& plot) {
|
||||
void drawWithTimeAxis(JKQTPlotter& plot) {
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPDatastore* ds=plot.getDatastore();
|
||||
|
||||
@ -169,10 +169,10 @@ void drawWithTimeAxis(JKQTPLotter& plot) {
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
JKQTPLotter plotDate;
|
||||
JKQTPlotter plotDate;
|
||||
drawWithDateAxis(plotDate);
|
||||
plotDate.move(100,100);
|
||||
JKQTPLotter plotTime;
|
||||
JKQTPlotter plotTime;
|
||||
drawWithTimeAxis(plotTime);
|
||||
plotTime.move(100,550);
|
||||
|
||||
|
@ -9,7 +9,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
# output executable name
|
||||
TARGET = jkqtplotter_simpletest_dateaxes
|
||||
|
||||
# include JKQTPLotter source code
|
||||
# include JKQTPlotter source code
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Example (JKQTPLotter): Different Types of Errorindicators {#JKQTPLotterErrorBarStyles}
|
||||
This project (see `./examples/simpletest_errorbarstyles/`) simply creates a JKQTPLotter widget (as a new window) and adds several curves show-casing different styles of error indicators. Data is initialized from two QVector<double> objects.
|
||||
# Example (JKQTPlotter): Different Types of Errorindicators {#JKQTPlotterErrorBarStyles}
|
||||
This project (see `./examples/simpletest_errorbarstyles/`) simply creates a JKQTPlotter widget (as a new window) and adds several curves show-casing different styles of error indicators. Data is initialized from two QVector<double> objects.
|
||||
|
||||
The source code of the main application can be found in [`jkqtplotter_simpletest_errorbarstyles.cpp`](../simpletest_errorbarstyles/jkqtplotter_simpletest_errorbarstyles.cpp).
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** \example jkqtplotter_simpletest_errorbarstyles.cpp
|
||||
* Shows how to use different error indicator styles with JKQTPLotter
|
||||
* Shows how to use different error indicator styles with JKQTPlotter
|
||||
*
|
||||
* \ref JKQTPLotterErrorBarStyles
|
||||
* \ref JKQTPlotterErrorBarStyles
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
@ -15,7 +15,7 @@ int main(int argc, char* argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPLotter plot;
|
||||
JKQTPlotter plot;
|
||||
JKQTPDatastore* ds=plot.getDatastore();
|
||||
|
||||
// 2. now we create data a vector of x-values for a simple plot
|
||||
|
@ -9,7 +9,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
# output executable name
|
||||
TARGET = jkqtplotter_simpletest_errorbarstyles
|
||||
|
||||
# include JKQTPLotter source code
|
||||
# include JKQTPlotter source code
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Example (JKQTPLotter): Filled Curve Plots {#JKQTPLotterFilledGraphs}
|
||||
This project (see `./examples/simpletest_filledgraphs/`) simply creates a JKQTPLotter widget (as a new window) and adds several filled curve graphs (Histograms). Data is initialized from QVector<int> objects.
|
||||
# Example (JKQTPlotter): Filled Curve Plots {#JKQTPlotterFilledGraphs}
|
||||
This project (see `./examples/simpletest_filledgraphs/`) simply creates a JKQTPlotter widget (as a new window) and adds several filled curve graphs (Histograms). Data is initialized from QVector<int> objects.
|
||||
|
||||
The source code of the main application can be found in [`jkqtplotter_simpletest_filledgraphs.cpp`](../simpletest_filledgraphs/jkqtplotter_simpletest_filledgraphs.cpp).
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** \example jkqtplotter_simpletest_filledgraphs.cpp
|
||||
* Shows how to use filled graphs with JKQTPLotter
|
||||
* Shows how to use filled graphs with JKQTPlotter
|
||||
*
|
||||
* \ref JKQTPLotterFilledGraphs
|
||||
* \ref JKQTPlotterFilledGraphs
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
@ -13,7 +13,7 @@ int main(int argc, char* argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
JKQTPLotter plot;
|
||||
JKQTPlotter plot;
|
||||
JKQTPDatastore* ds=plot.getDatastore();
|
||||
|
||||
// 2. now we create 4 datacolumns with length 256 entries in the datastore
|
||||
|
@ -12,7 +12,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
TARGET = jkqtplotter_simpletest_filledgraphs
|
||||
|
||||
|
||||
# include JKQTPLotter source code
|
||||
# include JKQTPlotter source code
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Example (JKQTPLotter): Plotting Mathematical Functions as Line Graphs {#JKQTPLotterFunctionPlots}
|
||||
# Example (JKQTPlotter): Plotting Mathematical Functions as Line Graphs {#JKQTPlotterFunctionPlots}
|
||||
## Basics
|
||||
This project (see `./examples/simpletest_functionplot/`) demonstrates how to plot mathematical functions as line graphs. The functions may be defined as static C functions, C++ functors or c++ inline functions. See [test/simpletest_parsedfunctionplot](../simpletest_parsedfunctionplot) for an example of how to use an internal equation parser provided with JKQTPLotter instead of directly defining functions.
|
||||
This project (see `./examples/simpletest_functionplot/`) demonstrates how to plot mathematical functions as line graphs. The functions may be defined as static C functions, C++ functors or c++ inline functions. See [test/simpletest_parsedfunctionplot](../simpletest_parsedfunctionplot) for an example of how to use an internal equation parser provided with JKQTPlotter instead of directly defining functions.
|
||||
|
||||
## Simple C++ inline function
|
||||
The first example shows how to plot a C++ inline function:
|
||||
@ -110,7 +110,7 @@ This code snippets above result in a plot like this:
|
||||
## Notes
|
||||
Note that all the different variants to provide parameters can be used with all types of functions!
|
||||
|
||||
Also see the example [Plotting Parsed Mathematical Functions as Line Graphs](../simpletest_parsedfunctionplot) for details on how the actual plotting algorithm works. That example also shows how to define a function as a string, which is then parsed and evaluated by an expression parser library embedded in JKQTPLotter.
|
||||
Also see the example [Plotting Parsed Mathematical Functions as Line Graphs](../simpletest_parsedfunctionplot) for details on how the actual plotting algorithm works. That example also shows how to define a function as a string, which is then parsed and evaluated by an expression parser library embedded in JKQTPlotter.
|
||||
|
||||
All examples above use the graph class `JKQTPXFunctionLineGraph`, which plots a function `y=f(x)`. If you want to plot a function `x=f(y)`, you can use the class `JKQTPYFunctionLineGraph` instead. If in the examples above, we exchange all `JKQTPXFunctionLineGraph` for `JKQTPYFunctionLineGraph`, the graphs will be rotated by 90 degree, as all functions are interpreted as `x=f(y)`:
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** \example jkqtplotter_simpletest_functionplot.cpp
|
||||
* Shows how to plot Mathematical Functions as Line Graphs with JKQTPLotter (as evaluated C/C++ functions)
|
||||
* Shows how to plot Mathematical Functions as Line Graphs with JKQTPlotter (as evaluated C/C++ functions)
|
||||
*
|
||||
* \ref JKQTPLotterFunctionPlots
|
||||
* \ref JKQTPlotterFunctionPlots
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
@ -29,9 +29,9 @@ int main(int argc, char* argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// 1. create a window that conatins a line-edit to edit a function
|
||||
// and a JKQTPLotter to display the function, combine everything in a layout
|
||||
// and a JKQTPlotter to display the function, combine everything in a layout
|
||||
QWidget mainWin;
|
||||
JKQTPLotter* plot=new JKQTPLotter(&mainWin);
|
||||
JKQTPlotter* plot=new JKQTPlotter(&mainWin);
|
||||
QVBoxLayout* layout=new QVBoxLayout;
|
||||
mainWin.setLayout(layout);
|
||||
layout->addWidget(plot);
|
||||
|
@ -10,7 +10,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
TARGET = jkqtplotter_simpletest_functionplot
|
||||
|
||||
|
||||
# include JKQTPLotter source code
|
||||
# include JKQTPlotter source code
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Example (JKQTPLotter): Plotting Geometric Objects {#JKQTPLotterGeometricGraphs}
|
||||
This project (see `./test/simpletest_geometric/`) shows the capabilities of JKQTPLotter to also draw geometric elements, like circles, ellipses, rectangles etc.
|
||||
# Example (JKQTPlotter): Plotting Geometric Objects {#JKQTPlotterGeometricGraphs}
|
||||
This project (see `./test/simpletest_geometric/`) shows the capabilities of JKQTPlotter to also draw geometric elements, like circles, ellipses, rectangles etc.
|
||||
|
||||
The source code of the main application can be found in [`jkqtplotter_simpletest_geometric.cpp`](../simpletest_geometric/jkqtplotter_simpletest_geometric.cpp). First a plot is generated and the axis aspect ration is set to 1, so an accurate plot is generated. Then several geometric graphs are added to the plot. Here are some examples, you can find more more examples in the source code of the example:
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** \example jkqtplotter_simpletest_geometric.cpp
|
||||
* Shows how to plot several geometric forms with JKQTPLotter
|
||||
* Shows how to plot several geometric forms with JKQTPlotter
|
||||
*
|
||||
* \ref JKQTPLotterGeometricGraphs
|
||||
* \ref JKQTPlotterGeometricGraphs
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
@ -14,7 +14,7 @@ int main(int argc, char* argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// 1. create a plotter window
|
||||
JKQTPLotter plot;
|
||||
JKQTPlotter plot;
|
||||
|
||||
// 2. format graph:
|
||||
// 2.1 set the graph scales manually
|
||||
|
@ -9,7 +9,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
# output executable name
|
||||
TARGET = jkqtplotter_simpletest_geometric
|
||||
|
||||
# include JKQTPLotter source code
|
||||
# include JKQTPlotter source code
|
||||
DEPENDPATH += . ../../lib
|
||||
INCLUDEPATH += ../../lib
|
||||
CONFIG (debug, debug|release) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Example (JKQTPLotter): Simple math image plot {#JKQTPLotterImagePlot}
|
||||
This project (see `./examples/simpletest_imageplot/`) simply creates a JKQTPLotter widget (as a new window) and adds a color-coded image plot of a mathematical function (here the Airy disk). The image is stored as a simple C-array in row-major ordering and then copied into a single column of the internal datasdtore (JKQTPMathImage could be directly used without the internal datastore). This very simple interface can also be used to interface with many common image processing libraries, like CImg or OpenCV.
|
||||
# Example (JKQTPlotter): Simple math image plot {#JKQTPlotterImagePlot}
|
||||
This project (see `./examples/simpletest_imageplot/`) simply creates a JKQTPlotter widget (as a new window) and adds a color-coded image plot of a mathematical function (here the Airy disk). The image is stored as a simple C-array in row-major ordering and then copied into a single column of the internal datasdtore (JKQTPMathImage could be directly used without the internal datastore). This very simple interface can also be used to interface with many common image processing libraries, like CImg or OpenCV.
|
||||
|
||||
The soruce code of the main application is (see [`jkqtplotter_simpletest_imageplot.cpp`](../simpletest_imageplot/jkqtplotter_simpletest_imageplot.cpp):
|
||||
The source code of the main application is (see [`jkqtplotter_simpletest_imageplot.cpp`](../simpletest_imageplot/jkqtplotter_simpletest_imageplot.cpp):
|
||||
```.cpp
|
||||
#include <QApplication>
|
||||
#include <cmath>
|
||||
@ -17,7 +17,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
JKQTPLotter plot;
|
||||
JKQTPlotter plot;
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
plot.get_plotter()->set_useAntiAliasingForGraphs(true); // nicer (but slower) plotting
|
||||
plot.get_plotter()->set_useAntiAliasingForSystem(true); // nicer (but slower) plotting
|
||||
@ -52,7 +52,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
|
||||
|
||||
// 3. make data available to JKQTPLotter by adding it to the internal datastore.
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
// In this step the contents of C-array airydisk is copied into a column
|
||||
// of the datastore in row-major order
|
||||
size_t cAiryDisk=ds->addCopiedImageAsColumn(airydisk, NX, NY, "imagedata");
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** \example jkqtplotter_simpletest_imageplot.cpp
|
||||
* Shows how to plot colored math images/matrices with JKQTPLotter
|
||||
* Shows how to plot colored math images/matrices with JKQTPlotter
|
||||
*
|
||||
* \ref JKQTPLotterImagePlot
|
||||
* \ref JKQTPlotterImagePlot
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
@ -18,7 +18,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
JKQTPLotter plot;
|
||||
JKQTPlotter plot;
|
||||
// 1. create a plotter window and get a pointer to the internal datastore (for convenience)
|
||||
plot.get_plotter()->set_useAntiAliasingForGraphs(true); // nicer (but slower) plotting
|
||||
plot.get_plotter()->set_useAntiAliasingForSystem(true); // nicer (but slower) plotting
|
||||
@ -53,7 +53,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
|
||||
|
||||
// 3. make data available to JKQTPLotter by adding it to the internal datastore.
|
||||
// 3. make data available to JKQTPlotter by adding it to the internal datastore.
|
||||
// In this step the contents of C-array airydisk is copied into a column
|
||||
// of the datastore in row-major order
|
||||
size_t cAiryDisk=ds->addCopiedImageAsColumn(airydisk, NX, NY, "imagedata");
|
||||
|