JKQtPlotter/tools/jkqtplotter_doc_imagegenerator
jkriege2 b0df7a1fd7 NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static)
NEW/BREAKING: refactor CMake-Code, so static/dynamic switch is done via <code>BUILD_SHARED_LIBS</code>, which retires <code>JKQtPlotter_BUILD_STATIC_LIBS</code>, <code>JKQtPlotter_BUILD_SHARED_LIBS</code> and removes the capability to build static and shared libraries in one location (fixes issue #104)
NEW: prepareed library for CMake's <a href="https://cmake.org/cmake/help/latest/module/FetchContent.html">FetchContent</a>-API
NEW: the different sub-libraries JKQTPlotter, JKQTFastPlotter (DEPRECATED), JKQTMath, JKQTMathText can be activated/deactivated with CMake options JKQtPlotter_BUILD_LIB_JKQTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTFASTPLOTTER, JKQtPlotter_BUILD_LIB_JKQTMATHTEXT, JKQtPlotter_BUILD_LIB_JKQTMATH
2024-01-16 13:07:08 +01:00
..
CMakeLists.txt NEW/BREAKING: provide general targets JKQTPlotter5/6::JKQTPlotter5/6, JKQTPlotter5/6::JKQTMathText5/6, ... which are independent of the type of build (shared/static) 2024-01-16 13:07:08 +01:00
jkqtplotter_doc_imagegenerator_and_lib.pro added command-line tool that auto-generates images for the JKQTPLotter documentation, implemented auto-generated plot-symbols 2022-09-02 22:59:41 +02:00
jkqtplotter_doc_imagegenerator.cpp fixed compile errors (using QString instead of std::string, where appropriate) 2023-12-19 10:38:58 +01:00
jkqtplotter_doc_imagegenerator.pro added command-line tool that auto-generates images for the JKQTPLotter documentation, implemented auto-generated plot-symbols 2022-09-02 22:59:41 +02:00
README.md dox update/fix 2022-09-19 21:55:12 +02:00

Tool (JKQTMathText): Command-Line Utility jkqtplotter_doc_imagegenerator

This command-line tool is used to generate images for the documentation.

For some of its options, it uses a JKQTBasePlotter to directly render an image without creating a visible window. The code then looks like this:

First we generate the JKQTBasePlotter object and add some data to the internal JKQTPDatastore

  JKQTBasePlotter plot(true);
  JKQTPDatastore* ds=plot.getDatastore();
  size_t cx=ds->addCopiedColumn(QVector<double>{-1.5,-0.5,0.5,1.5,2.5},"x");
  size_t cy=ds->addCopiedColumn(QVector<double>{-0.75,-0.3,-0.05,0.2,0.65},"y");

Now we set the range of x/y plot coordinates ...

  plot.setXY(-0.8,2.2,-0.5,0.7);

and the size of the widget, i.e. the size of the plot in the windowing system.

  plot.setWidgetSize(150,50);

Now we can add graphs to the plotter, e.g.

  JKQTPXYLineGraph* g=new JKQTPXYLineGraph(&plot);
  g->setXColumn(cx);
  g->setYColumn(cy);
  plot.addGraph(g);

Finally we store an image of the plot as PNG-file:

  plot.saveAsPixelImage("output.png", false, "png");