diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 090550ceab..3442384230 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -74,7 +74,7 @@ if(JKQtPlotter_BUILD_EXAMPLES) # e.g. "barchart/barchart,barchart_hor" # the basenames are applied to the windows in the order of their windowTitle()s! set(JKQTPlotter_GenerateDocScreenshots_From - scatter + scatter/scatter,scatter_error simpletest barchart/barchart,barchart_hor wiggleplots/wiggleplot_x,wiggleplot_y @@ -119,14 +119,14 @@ if(JKQtPlotter_BUILD_EXAMPLES) # custom target that generates the images for the JKQTMathText documentation set(JKQTPlotter_GenerateDocImage_DefaultOptions --screenshotdir="${CMAKE_CURRENT_LIST_DIR}/../doc/images/" --screenshotplot --disablehighdpi) set(JKQTPlotter_GenerateDocImages_From - stackedbars/JKQTPbarVerticalGraphStacked,JKQTPbarHorizontalGraphStacked - scatter/JKQTPXYScatterGraph - simpletest/JKQTPXYLineGraph - barchart/JKQTPBarVerticalGraph,JKQTPBarHorizontalGraph + stackedbars/JKQTPbarVerticalGraphStacked,JKQTPbarHorizontalGraphStacked/--smallscreenshotplot + scatter/JKQTPXYScatterGraph,JKQTPXYScatterErrorGraph/--smallscreenshotplot + simpletest/JKQTPXYLineGraph/--smallscreenshotplot + barchart/JKQTPBarVerticalGraph,JKQTPBarHorizontalGraph/--smallscreenshotplot wiggleplots/JKQTPFilledCurveXGraph_wiggle,JKQTPFilledCurveYGraph_wiggle - contourplot/JKQTPColumnContourPlot - filledgraphs/JKQTPFilledCurveXGraph,JKQTPFilledCurveYGraph - evalcurve/JKQTPXYFunctionLineGraph + contourplot/JKQTPColumnContourPlot/--smallscreenshotplot + filledgraphs/JKQTPFilledCurveXGraph,JKQTPFilledCurveYGraph/--smallscreenshotplot + evalcurve/JKQTPXYFunctionLineGraph/--smallscreenshotplot ) add_custom_target(JKQTPlotter_GenerateDocScreenshots @@ -147,12 +147,18 @@ if(JKQtPlotter_BUILD_EXAMPLES) foreach(ex ${JKQTPlotter_GenerateDocScreenshots_From}) string(REGEX MATCH "(.+)/(.+)" dummy ${ex}) + set(extra_command "") if(CMAKE_MATCH_1 STREQUAL "" OR CMAKE_MATCH_2 STREQUAL "") set(example ${ex}) set(basename ${ex}) else() set(example ${CMAKE_MATCH_1}) set(basename ${CMAKE_MATCH_2}) + if(NOT (CMAKE_MATCH_3 STREQUAL "")) + set(example ${CMAKE_MATCH_1}) + set(basename ${CMAKE_MATCH_2}) + set(extra_command ${CMAKE_MATCH_3}) + endif() endif() set(loc_target_name JKQTPlotter_GenerateDocScreenshots_${example}) @@ -160,7 +166,7 @@ if(JKQtPlotter_BUILD_EXAMPLES) string(TOUPPER ${example} example_upper) add_custom_target(${loc_target_name} COMMENT "Building JKQTPlotter Documentation Screenshot: ${example_upper}" - COMMAND $ ${JKQTPlotter_GenerateDocScreenshots_DefaultOptions} --screenshotbasename=${basename} + COMMAND $ ${JKQTPlotter_GenerateDocScreenshots_DefaultOptions} --screenshotbasename=${basename} ${extra_command} WORKING_DIRECTORY ${JKQtPlotter_QT_BINDIR} DEPENDS ${dep_name} ) @@ -177,12 +183,20 @@ if(JKQtPlotter_BUILD_EXAMPLES) foreach(ex ${JKQTPlotter_GenerateDocImages_From}) string(REGEX MATCH "(.+)/(.+)" dummy ${ex}) + set(extra_command "") if(CMAKE_MATCH_1 STREQUAL "" OR CMAKE_MATCH_2 STREQUAL "") set(example ${ex}) set(basename ${ex}) else() set(example ${CMAKE_MATCH_1}) set(basename ${CMAKE_MATCH_2}) + string(REGEX MATCH "(.+)/(.*)/(.+)" dummy ${ex}) + if(NOT (CMAKE_MATCH_3 STREQUAL "")) + set(example ${CMAKE_MATCH_1}) + set(basename ${CMAKE_MATCH_2}) + set(extra_command ${CMAKE_MATCH_3}) + endif() + endif() set(loc_target_name JKQTPlotter_GenerateDocImages_${example}) @@ -190,7 +204,7 @@ if(JKQtPlotter_BUILD_EXAMPLES) string(TOUPPER ${example} example_upper) add_custom_target(${loc_target_name} COMMENT "Building JKQTPlotter Documentation Image: ${example_upper}" - COMMAND $ ${JKQTPlotter_GenerateDocImage_DefaultOptions} --screenshotbasename=${basename} + COMMAND $ ${JKQTPlotter_GenerateDocImage_DefaultOptions} --screenshotbasename=${basename} ${extra_command} WORKING_DIRECTORY ${JKQtPlotter_QT_BINDIR} DEPENDS ${dep_name} ) diff --git a/doc/dox/examples_and_tutorials.dox b/doc/dox/examples_and_tutorials.dox index 2841f16d0d..9217029c4d 100644 --- a/doc/dox/examples_and_tutorials.dox +++ b/doc/dox/examples_and_tutorials.dox @@ -172,7 +172,7 @@ All test-projects are Qt-projects that use qmake to build. You can load them int
Screenshot Description Notes -
\image html test_multiplot_small.png +
\image html multiplot_small.png \subpage JKQTPlotterMultiPlotLayout Combining plots in Qt Layouts
linking plot axes
copy data from a `std::map` int the datastore
print plots/print preview
\image html test_styling_small.png @@ -214,7 +214,7 @@ All test-projects are Qt-projects that use qmake to build. You can load them int -
Screenshot Description Notes -
\image html test_multiplot_small.png +
\image html multiplot_small.png \subpage JKQTPlotterMultiPlotLayout Combining plots in Qt Layouts
linking plot axes
copy data from a `std::map` int the datastore
print plots/print preview
\image html test_distributionplot_small.png diff --git a/doc/dox/jkqtplotter.dox b/doc/dox/jkqtplotter.dox index 0f501f6d77..4834432e5b 100644 --- a/doc/dox/jkqtplotter.dox +++ b/doc/dox/jkqtplotter.dox @@ -284,7 +284,7 @@ This group assembles graphs that show their data with symbols and optionally wit \image html beeswarmplot_small.png JKQTPSingleColumnSymbolsGraph
\image html scatter_small.png + \image html JKQTPXYScatterGraph_small.png JKQTPXYScatterGraph, JKQTPXYScatterErrorGraph
\image html symbols_and_styles_small.png diff --git a/doc/images/JKQTPBarHorizontalGraph_small.png b/doc/images/JKQTPBarHorizontalGraph_small.png new file mode 100644 index 0000000000..9141b2b96c Binary files /dev/null and b/doc/images/JKQTPBarHorizontalGraph_small.png differ diff --git a/doc/images/JKQTPBarVerticalGraph_small.png b/doc/images/JKQTPBarVerticalGraph_small.png new file mode 100644 index 0000000000..40d060a10f Binary files /dev/null and b/doc/images/JKQTPBarVerticalGraph_small.png differ diff --git a/doc/images/JKQTPColumnContourPlot_small.png b/doc/images/JKQTPColumnContourPlot_small.png new file mode 100644 index 0000000000..502e7d2172 Binary files /dev/null and b/doc/images/JKQTPColumnContourPlot_small.png differ diff --git a/doc/images/JKQTPFilledCurveXGraph_small.png b/doc/images/JKQTPFilledCurveXGraph_small.png new file mode 100644 index 0000000000..8843ea1e2f Binary files /dev/null and b/doc/images/JKQTPFilledCurveXGraph_small.png differ diff --git a/doc/images/JKQTPFilledCurveYGraph_small.png b/doc/images/JKQTPFilledCurveYGraph_small.png new file mode 100644 index 0000000000..15f3fb4be4 Binary files /dev/null and b/doc/images/JKQTPFilledCurveYGraph_small.png differ diff --git a/doc/images/JKQTPXYFunctionLineGraph_small.png b/doc/images/JKQTPXYFunctionLineGraph_small.png new file mode 100644 index 0000000000..1179f1919f Binary files /dev/null and b/doc/images/JKQTPXYFunctionLineGraph_small.png differ diff --git a/doc/images/JKQTPXYLineGraph_small.png b/doc/images/JKQTPXYLineGraph_small.png new file mode 100644 index 0000000000..5910487b09 Binary files /dev/null and b/doc/images/JKQTPXYLineGraph_small.png differ diff --git a/doc/images/JKQTPXYScatterErrorGraph.png b/doc/images/JKQTPXYScatterErrorGraph.png new file mode 100644 index 0000000000..6031f2a825 Binary files /dev/null and b/doc/images/JKQTPXYScatterErrorGraph.png differ diff --git a/doc/images/JKQTPXYScatterErrorGraph_small.png b/doc/images/JKQTPXYScatterErrorGraph_small.png new file mode 100644 index 0000000000..f85ea05d6c Binary files /dev/null and b/doc/images/JKQTPXYScatterErrorGraph_small.png differ diff --git a/doc/images/JKQTPXYScatterGraph_small.png b/doc/images/JKQTPXYScatterGraph_small.png new file mode 100644 index 0000000000..fb7f5c47c3 Binary files /dev/null and b/doc/images/JKQTPXYScatterGraph_small.png differ diff --git a/doc/images/JKQTPbarHorizontalGraphStacked_small.png b/doc/images/JKQTPbarHorizontalGraphStacked_small.png new file mode 100644 index 0000000000..45525c1bdc Binary files /dev/null and b/doc/images/JKQTPbarHorizontalGraphStacked_small.png differ diff --git a/doc/images/JKQTPbarVerticalGraphStacked_small.png b/doc/images/JKQTPbarVerticalGraphStacked_small.png new file mode 100644 index 0000000000..54d9fed2c5 Binary files /dev/null and b/doc/images/JKQTPbarVerticalGraphStacked_small.png differ diff --git a/examples/scatter/scatter.cpp b/examples/scatter/scatter.cpp index 9d37b896a9..35cf4ed6f8 100644 --- a/examples/scatter/scatter.cpp +++ b/examples/scatter/scatter.cpp @@ -11,16 +11,7 @@ #include "jkqtpexampleapplication.h" #include - -int main(int argc, char* argv[]) -{ - - JKQTPAppSettingController highDPIController(argc,argv); - JKQTPExampleApplication app(argc, argv); - - - // 1. create a plotter window and get a pointer to the internal datastore (for convenience) - JKQTPlotter plot; +void createScatterGraph(JKQTPlotter&plot) { JKQTPDatastore* ds=plot.getDatastore(); // 2. add two columns to the JKQTPDatastore and obtain back-inserter iterators for these @@ -60,6 +51,88 @@ int main(int argc, char* argv[]) plot.getPlotter()->setPlotLabel(QObject::tr("Scatter Example")); plot.show(); plot.resize(600/plot.devicePixelRatioF(),400/plot.devicePixelRatioF()); +} + + +void createErrorScatterGraph(JKQTPlotter&plot) { + JKQTPDatastore* ds=plot.getDatastore(); + + // 2. add two columns to the JKQTPDatastore and obtain back-inserter iterators for these + size_t columnX=ds->addColumn("x"); + auto colXInserter=ds->backInserter(columnX); + size_t columnY=ds->addColumn("y"); + auto colYInserter=ds->backInserter(columnY); + size_t columnY2=ds->addColumn("y2"); + auto colY2Inserter=ds->backInserter(columnY2); + size_t columnEX=ds->addColumn("xerr"); + auto colEXInserter=ds->backInserter(columnEX); + size_t columnEY=ds->addColumn("yerr"); + auto colEYInserter=ds->backInserter(columnEY); + + // 3. now we create data for a simple plot (a sine curve with random noise) + std::default_random_engine generator(123); + std::normal_distribution distribution(0,0.5); + const int Ndata=15; + for (int i=0; isetXColumn(columnX); + graph1->setYColumn(columnY); + graph1->setYErrorColumn(columnEY); + graph1->setYErrorStyle(JKQTPErrorSimpleBars); + graph1->setTitle(QObject::tr("y-errorlines")); + plot.addGraph(graph1); + + JKQTPXYScatterErrorGraph* graph2=new JKQTPXYScatterErrorGraph(&plot); + graph2->setXColumn(columnX); + graph2->setYColumn(columnY2); + graph2->setXErrorColumn(columnEX); + graph2->setYErrorColumn(columnEY); + graph2->setXErrorStyle(JKQTPErrorBars); + graph2->setYErrorStyle(JKQTPErrorBars); + graph2->setTitle(QObject::tr("xy-errorbars")); + plot.addGraph(graph2); + + // 6. autoscale the plot so the graph is contained + plot.zoomToFit(); + + // show plotter and make it a decent size + plot.getPlotter()->setPlotLabel(QObject::tr("Error Scatter Example")); + plot.show(); + plot.resize(600/plot.devicePixelRatioF(),400/plot.devicePixelRatioF()); +} + +int main(int argc, char* argv[]) +{ + + JKQTPAppSettingController highDPIController(argc,argv); + JKQTPExampleApplication app(argc, argv); + + + // 1. create a plotter window and get a pointer to the internal datastore (for convenience) + JKQTPlotter plot, plotErr; + + createScatterGraph(plot); + plot.setWindowTitle("1: JKQTPXYScatterGraph"); + createErrorScatterGraph(plotErr); + plotErr.setWindowTitle("2: JKQTPXYScatterErrorGraph"); + return app.exec(); } diff --git a/lib/jkqtmathtext/jkqtmathtext.h b/lib/jkqtmathtext/jkqtmathtext.h index 2a72b7e8d0..454f3380df 100644 --- a/lib/jkqtmathtext/jkqtmathtext.h +++ b/lib/jkqtmathtext/jkqtmathtext.h @@ -57,7 +57,7 @@ class JKQTMathTextVerticalListNode; // forward The implementation is split over several classes: - JKQTMathText implements drawing, based on a memory representatioj of the markup. It also provides an interface for class users. - JKQTMathTextParser and its children like JKQTMathTextLatexParser parses mathamtical markup. - - The nodes summarized in \ref jkqtmathtext_nodes are used to build the memory representation of the markup. + - The nodes summarized in \ref jkqtmathtext_items are used to build the memory representation of the markup. . In particular JKQTMathTextLatexParser actually parses e.g. a LaTeX string and draws it in pure C++. It does NOT rely diff --git a/lib/jkqtmathtext/nodes/jkqtmathtextnode.h b/lib/jkqtmathtext/nodes/jkqtmathtextnode.h index 2f3cb64489..10aae9eea3 100644 --- a/lib/jkqtmathtext/nodes/jkqtmathtextnode.h +++ b/lib/jkqtmathtext/nodes/jkqtmathtextnode.h @@ -91,10 +91,8 @@ class JKQTMATHTEXT_LIB_EXPORT JKQTMathTextNode { * * \param painter painter to use for determining the size * \param currentEv current environment object - * \param[out] width width of the block/node - * \param[out] baselineHeight distance from the bottom of the block/node-box to the baseline - * \param[out] overallHeight overall height (bottom to top) of the node, the ascent is \c overallHeight-baselineHeight - * \param[out] strikeoutPos position of the strikeout-line + * + * \return all important box size parameters packed as JKQTMathTextNodeSize * */ virtual JKQTMathTextNodeSize getSizeInternal(QPainter& painter, JKQTMathTextEnvironment currentEv) const =0; diff --git a/lib/jkqtplotter/graphs/jkqtpscatter.h b/lib/jkqtplotter/graphs/jkqtpscatter.h index 353f3f8fba..e2038ef0f6 100644 --- a/lib/jkqtplotter/graphs/jkqtpscatter.h +++ b/lib/jkqtplotter/graphs/jkqtpscatter.h @@ -89,7 +89,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPXYScatterGraph: public JKQTPXYGraph, public JK /*! \brief This implements xy scatter plots with x and y error indicators. \ingroup jkqtplotter_linesymbolgraphs_simple - \image html plot_errorbarscatterlots.png + \image html JKQTPXYScatterErrorGraph.png \see JKQTPXYScatterGraph, JKQTPXYGraphErrors */ diff --git a/lib/jkqtplotter/jkqtplotter.h b/lib/jkqtplotter/jkqtplotter.h index 805be709bd..eb8f6277d1 100644 --- a/lib/jkqtplotter/jkqtplotter.h +++ b/lib/jkqtplotter/jkqtplotter.h @@ -140,7 +140,7 @@ JKQTPLOTTER_LIB_EXPORT void initJKQTPlotterResources(); * * Often a single plot is not sufficient, but several plots need to be aligned with respect to each other: * - * \image html test_multiplot.png + * \image html multiplot.png * * In the Qt Window this is achieved by placing several JKQTPlotter objects into a QGridLayout. * In order to support this alignment, also when exporting/printing a plot, and when the user interactions with the plot (e.g. zooming), diff --git a/screenshots/evalcurve.png b/screenshots/evalcurve.png index 8e595041c7..2f5a2798cd 100644 Binary files a/screenshots/evalcurve.png and b/screenshots/evalcurve.png differ diff --git a/screenshots/evalcurve_small.png b/screenshots/evalcurve_small.png index 1179f1919f..81f151e38d 100644 Binary files a/screenshots/evalcurve_small.png and b/screenshots/evalcurve_small.png differ diff --git a/screenshots/multiplot.png b/screenshots/multiplot.png index 2b3791bcad..1deba82b3b 100644 Binary files a/screenshots/multiplot.png and b/screenshots/multiplot.png differ diff --git a/screenshots/multiplot_controlwindow.png b/screenshots/multiplot_controlwindow.png index bf548904a3..5fe791c503 100644 Binary files a/screenshots/multiplot_controlwindow.png and b/screenshots/multiplot_controlwindow.png differ diff --git a/screenshots/multiplot_controlwindow_small.png b/screenshots/multiplot_controlwindow_small.png index b755e78628..8e87106b18 100644 Binary files a/screenshots/multiplot_controlwindow_small.png and b/screenshots/multiplot_controlwindow_small.png differ diff --git a/screenshots/multiplot_small.png b/screenshots/multiplot_small.png index bbbea2c4cd..2ae9c0f0f6 100644 Binary files a/screenshots/multiplot_small.png and b/screenshots/multiplot_small.png differ diff --git a/screenshots/scatter_error.png b/screenshots/scatter_error.png new file mode 100644 index 0000000000..18ae8acbda Binary files /dev/null and b/screenshots/scatter_error.png differ diff --git a/screenshots/scatter_error_small.png b/screenshots/scatter_error_small.png new file mode 100644 index 0000000000..f85ea05d6c Binary files /dev/null and b/screenshots/scatter_error_small.png differ