diff --git a/doc/images/jkqtmathtext/jkqtmathtext_unicode.png b/doc/images/jkqtmathtext/jkqtmathtext_unicode.png index 936f5db9ee..8795d2d29b 100644 Binary files a/doc/images/jkqtmathtext/jkqtmathtext_unicode.png and b/doc/images/jkqtmathtext/jkqtmathtext_unicode.png differ diff --git a/examples/barchart_errorbars/barchart_errorbars.cpp b/examples/barchart_errorbars/barchart_errorbars.cpp index 35f5e85b35..0b9639532c 100644 --- a/examples/barchart_errorbars/barchart_errorbars.cpp +++ b/examples/barchart_errorbars/barchart_errorbars.cpp @@ -22,7 +22,7 @@ void doExample(JKQTPlotter& plot, const QString& title) // 2. now we create three columns for key and value size_t columnK=ds->addLinearColumn(6, 0.4*JKQTPSTATISTICS_PI, 2.2*JKQTPSTATISTICS_PI,"k"); - size_t columnV=ds->addColumnCalculatedFromColumn(columnK, &cos, "v"); + size_t columnV=ds->addColumnCalculatedFromColumn(columnK, [](double x) { return cos(x); }, "v"); size_t columnE=ds->addColumnCalculatedFromColumn(columnK, [](double x) { return 0.05+0.06*(1.0+sin(x)); }, "error"); // 3. create a graph in the plot, which plots the dataset with symmetric: diff --git a/examples/barchart_twocolor/barchart_twocolor.cpp b/examples/barchart_twocolor/barchart_twocolor.cpp index 7eab3af058..d248bb0d74 100644 --- a/examples/barchart_twocolor/barchart_twocolor.cpp +++ b/examples/barchart_twocolor/barchart_twocolor.cpp @@ -22,7 +22,7 @@ void doExample(JKQTPlotter& plot, const QString& title) // 2. now we create two columns for key and value size_t columnK=ds->addLinearColumn(15, 0.5*JKQTPSTATISTICS_PI, 3.0*JKQTPSTATISTICS_PI,"k"); - size_t columnV=ds->addColumnCalculatedFromColumn(columnK, &cos, "v"); + size_t columnV=ds->addColumnCalculatedFromColumn(columnK, [](double x) { return cos(x); }, "v"); // 3. create graph in the plot, which plots the dataset: JKQTPBarGraphBase* graph=new TCHART(&plot); diff --git a/examples/filledgraphs_errors/README.md b/examples/filledgraphs_errors/README.md index cbeacbe168..4f9d490acd 100644 --- a/examples/filledgraphs_errors/README.md +++ b/examples/filledgraphs_errors/README.md @@ -7,24 +7,53 @@ The source code of the main application is (see [`filledgraphs_errors.cpp`](http JKQTPlotter plot; JKQTPDatastore* ds=plot.getDatastore(); - // 2. now we create two columns for key and value - size_t columnK=ds->addLinearColumn(10, 0, 2.0*JKQTPSTATISTICS_PI,"k"); - size_t columnV=ds->addColumnCalculatedFromColumn(columnK, &cos, "v"); + // 2. now we create three columns for key and value + size_t columnK=ds->addLinearColumn(9, 0.1*JKQTPSTATISTICS_PI, 1.0*JKQTPSTATISTICS_PI,"k"); + size_t columnK2=ds->addLinearColumn(9, 1.1*JKQTPSTATISTICS_PI, 2.0*JKQTPSTATISTICS_PI,"k2"); + size_t columnK3=ds->addLinearColumn(9, 2.1*JKQTPSTATISTICS_PI, 3.0*JKQTPSTATISTICS_PI,"k2"); + size_t columnV=ds->addColumnCalculatedFromColumn(columnK, [](double x) { return sin(x); }, "v"); + size_t columnV2=ds->addColumnCalculatedFromColumn(columnK2, [](double x) { return -sin(x); }, "v2"); + size_t columnV3=ds->addColumnCalculatedFromColumn(columnK3, [](double x) { return sin(x); }, "v3"); + size_t columnE=ds->addColumnCalculatedFromColumn(columnV, [](double x) { return 0.2*x; }, "error"); + size_t columnE2=ds->addColumnCalculatedFromColumn(columnV2, [](double x) { return 0.2*x; }, "error"); + size_t columnE3=ds->addColumnCalculatedFromColumn(columnV3, [](double x) { return 0.2*x; }, "error"); - // 3. create graph in the plot, which plots the dataset: - JKQTPBarGraphBase* graph=new JKQTPBarVerticalGraph(&plot); - graph->setKeyColumn(columnK); - graph->setValueColumn(columnV); - // set TwoColor fill Mode - graph->setFillMode(JKQTPBarGraphBase::FillMode::TwoColorFilling); - graph->setFillColor(QColor("green")); - graph->fillStyleBelow().setFillColor(QColor("red")); - plot.addGraph(graph); + // 3. create a graph in the plot, which plots the dataset with symmetric: + JKQTPFilledCurveXErrorGraph* graph1=new JKQTPFilledCurveXErrorGraph(&plot); + graph1->setKeyColumn(columnK); + graph1->setValueColumn(columnV); + graph1->setValueErrorColumn(columnE); + // set error indicator style + graph1->setValueErrorStyle(JKQTPErrorBars); + graph1->setTitle(QObject::tr("JKQTPErrorBars")); + plot.addGraph(graph1); - // 4 autoscale the plot so the graph is contained + // 4. create a second graph in the plot, which plots the second dataset with outer error bars only: + JKQTPFilledCurveXErrorGraph* graph2=new JKQTPFilledCurveXErrorGraph(&plot); + graph2->setKeyColumn(columnK2); + graph2->setValueColumn(columnV2); + graph2->setValueErrorColumn(columnE2); + // set error indicator style + graph2->setValueErrorStyle(JKQTPErrorPolygons); + graph2->setTitle(QObject::tr("JKQTPErrorPolygons")); + plot.addGraph(graph2); + + // 5. create a third graph in the plot, which plots the second dataset with outer error bars only: + JKQTPFilledCurveXErrorGraph* graph3=new JKQTPFilledCurveXErrorGraph(&plot); + graph3->setKeyColumn(columnK3); + graph3->setValueColumn(columnV3); + graph3->setValueErrorColumn(columnE3); + // set error indicator style + graph3->setValueErrorStyle(JKQTPErrorLines); + graph3->setTitle(QObject::tr("JKQTPErrorLines")); + plot.addGraph(graph3); + + + // 6 autoscale the plot so the graph is contained plot.zoomToFit(); - // 5. show plotter and make it a decent size + // 7. show plotter and make it a decent size + plot.getPlotter()->setKeyPosition(JKQTPKeyInsideBottomLeft); plot.setWindowTitle(title); plot.show(); plot.resize(400,400); @@ -37,8 +66,8 @@ The result looks like this: -In order to draw horizontal error bars, you have to use `JKQTPBarHorizontalGraph` instead of `JKQTPBarVerticalGraph`: +In order to draw horizontal error bars, you have to use `JKQTPFilledCurveYErrorGraph` instead of `JKQTPFilledCurveXErrorGraph`: -![filledgraphs_errors_hor](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/filledgraphs_errors_hor.png) +![filledgraphs_errors_hor](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/filledgraphs_errors_y.png) diff --git a/examples/filledgraphs_errors/filledgraphs_errors.cpp b/examples/filledgraphs_errors/filledgraphs_errors.cpp index 42b957dfe6..d3f156b0d0 100644 --- a/examples/filledgraphs_errors/filledgraphs_errors.cpp +++ b/examples/filledgraphs_errors/filledgraphs_errors.cpp @@ -24,9 +24,9 @@ void doExample(JKQTPlotter& plot, const QString& title) size_t columnK=ds->addLinearColumn(9, 0.1*JKQTPSTATISTICS_PI, 1.0*JKQTPSTATISTICS_PI,"k"); size_t columnK2=ds->addLinearColumn(9, 1.1*JKQTPSTATISTICS_PI, 2.0*JKQTPSTATISTICS_PI,"k2"); size_t columnK3=ds->addLinearColumn(9, 2.1*JKQTPSTATISTICS_PI, 3.0*JKQTPSTATISTICS_PI,"k2"); - size_t columnV=ds->addColumnCalculatedFromColumn(columnK, &sin, "v"); + size_t columnV=ds->addColumnCalculatedFromColumn(columnK, [](double x) { return sin(x); }, "v"); size_t columnV2=ds->addColumnCalculatedFromColumn(columnK2, [](double x) { return -sin(x); }, "v2"); - size_t columnV3=ds->addColumnCalculatedFromColumn(columnK3, &sin, "v3"); + size_t columnV3=ds->addColumnCalculatedFromColumn(columnK3, [](double x) { return sin(x); }, "v3"); size_t columnE=ds->addColumnCalculatedFromColumn(columnV, [](double x) { return 0.2*x; }, "error"); size_t columnE2=ds->addColumnCalculatedFromColumn(columnV2, [](double x) { return 0.2*x; }, "error"); size_t columnE3=ds->addColumnCalculatedFromColumn(columnV3, [](double x) { return 0.2*x; }, "error"); diff --git a/screenshots/imageplot_userpal_program.png b/screenshots/imageplot_userpal_program.png index 6a3bcd14e4..b6ffc533ff 100644 Binary files a/screenshots/imageplot_userpal_program.png and b/screenshots/imageplot_userpal_program.png differ diff --git a/screenshots/imageplot_userpal_program_small.png b/screenshots/imageplot_userpal_program_small.png index 24cf2c20e3..54b2592b01 100644 Binary files a/screenshots/imageplot_userpal_program_small.png and b/screenshots/imageplot_userpal_program_small.png differ diff --git a/screenshots/parsedfunctionplot.png b/screenshots/parsedfunctionplot.png index cb0d6f73d4..56cd53f4bd 100644 Binary files a/screenshots/parsedfunctionplot.png and b/screenshots/parsedfunctionplot.png differ diff --git a/screenshots/parsedfunctionplot_small.png b/screenshots/parsedfunctionplot_small.png index ad444bae21..6a97c54db1 100644 Binary files a/screenshots/parsedfunctionplot_small.png and b/screenshots/parsedfunctionplot_small.png differ