JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
Collaboration diagram for Styling System:

JKQTPlotter (and JKQTBasePlotter) offer a styling system, which allows to easily define and transfer plot styling from one object to another. The system is based on a hirarchy of structs, which summarize properties, describing how a plot looks in general. The classes contained in this system are:

In addition there are static methods that allow to manage a system-wide (actually program-instance wide) style that is applied to any new instance of JKQTPlotter and JKQTBasePlotter on construction:

You can e.g. use these general methods to alter the styles for all JKQTPlotter instances, created in the future:

// load the system-wide default settings from an INI-file:
QSettings plotSettings("JKQTPlotterSettings.ini", QSettings::IniFormat);;
// alter a system-wide default setting by hand (here: set color of zooming rect to red)
JKQTPGetSystemDefaultStyle().userActionColor=QColor("red");
void loadSettings(const QSettings &settings, const QString &group=QString("plots/"), const JKQTBasePlotterStyle &defaultStyle=JKQTBasePlotterStyle())
loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object
void loadSettings(const QSettings &settings, const QString &group=QString("plots/"), const JKQTPlotterStyle &defaultStyle=JKQTPlotterStyle())
loads the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object
JKQTPLOTTER_LIB_EXPORT JKQTPlotterStyle & JKQTPGetSystemDefaultStyle()
returns the system-wide default JKQTPlotterStyle
JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyle & JKQTPGetSystemDefaultBaseStyle()
returns the system-wide default JKQTPlotterStyle

Several pre-made styles are available in the JKQTPlotter repository (https://github.com/jkriege2/JKQtPlotter/tree/master/lib/jkqtplotter/resources/styles/). These are also linked into the JKQTPlotter library as Qt ressource into the subdirectory :/JKQTPlotter/styles/ . You can use them as follows:

QSettings plotSettings(":/JKQTPlotter/styles/blackandwhite.ini", QSettings::IniFormat);;

Here is a table with all available ready-made styles:

Style-file Screenshot Symbols
:/JKQTPlotter/styles/default.ini
:/JKQTPlotter/styles/blueprint.ini
:/JKQTPlotter/styles/cyberpunk.ini
:/JKQTPlotter/styles/dark.ini
:/JKQTPlotter/styles/blackandwhite.ini
:/JKQTPlotter/styles/legacy_default_style.ini
:/JKQTPlotter/styles/seaborn.ini
:/JKQTPlotter/styles/simple_arrowsaxes.ini
:/JKQTPlotter/styles/simple_axesoffset.ini
:/JKQTPlotter/styles/simple_axesoffset_plotbox.ini
:/JKQTPlotter/styles/simple_gridandticks.ini
:/JKQTPlotter/styles/simple_noaxes.ini
See also
Classes are documented in Styling System Classes .
See Tutorial (JKQTPlotter): Styling a JKQtPlotter for a detailed example.