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
jkqtpcoordinateaxes.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger (<jan@jkrieger.de>)
3
4
5
6 This software is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License (LGPL) as published by
8 the Free Software Foundation, either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License (LGPL) for more details.
15
16 You should have received a copy of the GNU Lesser General Public License (LGPL)
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21
22
23#ifndef JKQTPCOORDINATEAXES_H
24#define JKQTPCOORDINATEAXES_H
25
26
27#include <QString>
28#include <QPainter>
29#include <QPair>
30#include <QSettings>
31#include "jkqtplotter/jkqtptools.h"
32#include "jkqtmathtext/jkqtmathtext.h"
33#include "jkqtplotter/jkqtplotter_imexport.h"
34#include "jkqtplotter/jkqtpcoordinateaxesstyle.h"
35
36// forward declarations
37class JKQTBasePlotter;
38
39/*! \brief named references for different oordinate axes in the plot
40 \ingroup jkqtpplottersupprt
41*/
46
47/*! \brief type for indexing coordinate axes in a plot
48 \ingroup jkqtpplottersupprt
49*/
51
52/*! \brief this virtual class is the base for any type of coordinate axis, to be drawn by JKQTBasePlotter.
53 \ingroup jkqtpbaseplotter_elements
54
55 Classes derived from JKQTPCoordinateAxis implements all the functionality needed for a coordinate axis:
56 - transform world to screen coordinates and vice versa
57 - draw the axis (implemented by child classes!) with these elements: axis lines, ticks, tick labels, axis label, x/y=0 axis
58 - measure the axes in screen coordinates
59 - load and save the settings to an ini file
60 .
61
62 Most of the actual draw and measure functions have to be implemented in descendents of this class (namely
63 JKQTPHorizontalAxis and JKQTPVerticalAxis, as they are specific to whether the axis is drawn horizontally or
64 vertically.
65
66 Each axis is split up into several parts, as depicted in this image:
67
68 \image html jkqtpcoordinateaxis1.png
69
70 Which parts to actually draw is set by the diverse properties.
71
72
73 \section jkqtplotter_base_systems_baseelements Coordinate Systems and Transformations
74 The plot itself is positioned inside the widget (see \ref jkqtplotter_base_plotsize for details).
75 You simply supply the widget dimensions and the border
76 widths between the plot and the widget. The Object then calculates the size of the plot:
77
78 \image html plot_widget_orientation.png
79
80 The plot shows the parameter range xmin ... xmax and ymin ... ymax. Note that if you plot logarithmic plots
81 you may only plot positive (>0) values. Any other value may lead to an error or unpredictable behaviour.
82
83 From these parameters the object calculates the scaling laws for plotting pints to the screen. The next paragraphs
84 show all calculations for x- and y-coordinates, ahough this class only implements a generic form. The actual calculation
85 is also influenced by the parameters set in the child classes!
86
87 -# <tt>width = xmax - xmin</tt>
88 -# <tt>height = ymax - ymin</tt>
89 -# <tt>plotWidth = widgetWidth - plotBorderLeft - plotBorderRight</tt>
90 -# <tt>plotHeight = widgetHeight - plotBorderTop - plotBorderBottom</tt>
91 -# <tt>xPlotOffset = plotBorderLeft</tt>
92 -# <tt>yPlotOffset = plotBorderTop</tt>
93 .
94 These parameters are common to all scaling laws. The next image explains these formulas:
95
96 \image html plot_coordinates.png
97
98 The actual scaling laws \f$ (x_p(x), y_p(y)) \f$ may be derived from these equations:
99 \f[ x_p(\mbox{xmin})=\mbox{xPlotOffset},\ \ \ \ \ x_p(\mbox{xmax})=\mbox{xPlotOffset}+\mbox{plotWidth} \f]
100 \f[ y_p(\mbox{ymax})=\mbox{yPlotOffset},\ \ \ \ \ y_p(\mbox{ymin})=\mbox{yPlotOffset}+\mbox{plotHeight} \f]
101 Here \f$ (x_p, y_p) \f$ denotes a point in pixel coordinates (green coordinate system) and \f$ (x,y) \f$ denotes a point in the
102 plotting coordinate system.
103
104 If you assume a <b>linear scaling law</b>. \f[ x_p(x)=\mbox{xoffset}+x\cdot\mbox{xscale} \ \ \ \ \ \ \ \ \ y_p(y)=\mbox{yoffset}-y\cdot\mbox{yscale} \f]
105 you can derive:
106 \f[ \mbox{xscale}=\frac{\mbox{plotWidth}}{\mbox{xwidth}},\ \ \ \ \ \ \mbox{xoffset}=\mbox{xPlotOffset}-\mbox{xmin}\cdot\mbox{xscale} \f]
107 \f[ \mbox{yscale}=\frac{\mbox{plotHeight}}{\mbox{ywidth}},\ \ \ \ \ \ \mbox{yoffset}=\mbox{yPlotOffset}+\mbox{ymax}\cdot\mbox{yscale} \f]
108
109 If you have a <b>logarithmic axis</b> (i.e. we plot \f$ \log_b(x) \f$ insetad of \f$ x \f$ for a given base \f$ b \f$ ) we get the same
110 formulas, but with \f$ x \f$ exchanged by \f$ \log_b(x) \f$. If we use the equation \f$ \log_b(x)=\log(x)/\log(b) \f$ we finally get
111 the scaling laws:
112 \f[ x_p(x)=\mbox{xoffset}+\frac{\log(x)}{\log(\mbox{logXAxisBase})}\cdot\mbox{xscale} \ \ \ \ \ \ \ \ \ y_p(y)=\mbox{yoffset}-\frac{\log(y)}{\log(\mbox{logYAxisBase})}\cdot\mbox{yscale} \f]
113 From these we can calculate their parameters with the same defining equations as above:
114 \f[ \mbox{xscale}=\frac{\mbox{plotWidth}\cdot\log(\mbox{logXAxisBase})}{\log(\mbox{xmax})-\log(\mbox{xmin})},\ \ \ \ \ \ \mbox{xoffset}=\mbox{xPlotOffset}-\frac{\log(\mbox{xmin})}{\log(\mbox{logXAxisBase})}\cdot\mbox{xscale} \f]
115 \f[ \mbox{yscale}=\frac{\mbox{plotHeight}\cdot\log(\mbox{logYAxisBase})}{\log(\mbox{ymax})-\log(\mbox{ymin})},\ \ \ \ \ \ \mbox{yoffset}=\mbox{yPlotOffset}+\frac{\log(\mbox{ymax})}{\log(\mbox{logYAxisBase})}\cdot\mbox{yscale} \f]
116
117 The object implements the above coordinate transformations in the (inline) method x2p(). The inverse transformations
118 are implemented in p2x(). They can be used to show the system coordinates of the current mouse position.
119
120
121 \section jkqtplotter_coordinateaxes_inverted Inverted Coordinate Axes
122
123 In some cases it may be necessary to invert the direction of increasing coordinates on an axis. One such case is image analysis, as computer images usually
124 have coordinates starting with (0,0) at the top left and increasing to the right (x) and down (y). You can invert any axis by setting \c setInverted(true).
125
126 \image html jkqtplotter_inverted_yaxis.png
127
128 \see You can find example here: \ref JKQTPlotterImagePlotQImageRGB and \ref JKQTPlotterImagePlotRGBOpenCV
129
130
131 \section jkqtplotter_base_grids_baseelemenets Axis Ticks and Grids
132 This section explains how this component draws the ticks on coordinate axes and the grids that may be drawn below
133 the plots. In principle both - grids and axes - are drawn the same way, i.e. with the same step widths. There are
134 two types of ticks and grids: The major and the minor ticks/grids. The major ticks also show a label that denotes the
135 value they represent. Between two major ticks the axis shows \a JKQTPCoordinateAxisStyle::minorTicks small ticks that are not
136 accompanied by a label. The next image shows an example of an axis:
137
138 \image html plot_axis_ticksandlabels.png
139
140 For the labels this class also uses an algorithm that extimates the number of valid digits (after the comma) that are
141 needed so that two adjacent labels do not show the same text, so if you plot the range 1.10 .. 1.15 The algorithm will
142 show at least two valid digits, as with one digit the labels would be 1.1, 1.1, 1.1, 1.1, 1.1, 1.1. With two digits they
143 are 1.10, 1.11, 1.12, 1.13, 1.14, 1.15. The class may also use a method that can write \c 1m instead of \c 0.001 and \c 1k
144 instead of \c 1000 (the algorithm supports the "exponent letters" f, p, n, u, m, k, M, G, T, P. The latter option may
145 (de)activated by using showXExponentCharacter and showYExponentCharacter.
146
147 For grids applies the same. There are two grids that are drawn in different styles (often the major grid is drawn
148 thicker and darker than the minor grid).
149
150 The minor ticks and grid lines are generated automatically, depending in the setting of \a JKQTPCoordinateAxisStyle::minorTicks.
151 These properties give the number of minor ticks between two major ticks, so if the major ticks are at 1,2,3,... and you
152 want minor ticks at 1.1, 1.2, 1.3,... then you will have to set \c JKQTPCoordinateAxisStyle::minorTicks=9 as there are nine ticks between two major
153 ticks. So the minor tick spacing is calculated as: \f[ \Delta\mbox{MinorTicks}=\frac{\Delta\mbox{ticks}}{\mbox{minorTicks}+1} \f]
154
155 The same applies for logarithmic axes. If the major ticks are at 1,10,100,... and you set \c JKQTPCoordinateAxisStyle::minorTicks=9 the program will
156 generate 9 equally spaced minor ticks in between, so you have minor ticks at 2,3,4,...,11,12,13,... This results in a standard
157 logarithmic axis. If you set \c JKQTPCoordinateAxisStyle::minorTicks=1 then you will get minor ticks at 5,15,150,...
158
159 \image html plot_logaxis_ticksandlabels.png
160
161 The major tick-tick distances of linear axes may be calculated automatically in a way that the axis shows at least a given
162 number of ticks \c JKQTPCoordinateAxisStyle::minTicks. The algorithm takes that tick spacing that will give a number of ticks per axis
163 nearest but \c ">=" to the given \c JKQTPCoordinateAxisStyle::minTicks. The Algorithm is described in detail with the function
164 calcLinearTickSpacing(). To activate this automatic tick spacing you have to set <code>autoAxisSpacing=true</code>.
165
166 \section jkqtplotter_coordinateaxes_tickscaling Axis Tick Units/Scaling
167 In some cases it is desired to put the axis ticks not at 1,2,3,... but rather at \f$ 1\pi \f$ , \f$ 2\pi \f$ , \f$ 3\pi \f$ or any other
168 unit than \f$ pi \f$ ,i.e.:
169
170 \image html axisstyle/axis_unit_scaling_none.png "no axis scaling (default case)"
171 \image html axisstyle/axis_unit_scaling_pi.png "pi-axis scaling"
172
173 You can use these methods to set such a factor:
174 - JKQTPCoordinateAxis::setTickUnitFactor() for the actual factor and setTickUnitName() for a name, added to the tick label
175 - JKQTPCoordinateAxis::setTickUnit() sets factor and name in one call
176 - JKQTPCoordinateAxis::setTickUnitPi() shortcut to set pi-scaling
177 - JKQTPCoordinateAxis::resetTickUnit() resets to no-scaling (default case)
178 .
179
180 */
182 Q_OBJECT
183 protected:
184 public:
185
186 /** \brief class constructor */
188 /** \brief class destructor */
190 virtual void setParent(JKQTBasePlotter* parent);
191 /** \brief loads the plot properties from a QSettings object */
192 virtual void loadSettings(const QSettings &settings, const QString& group=QString("plots/axes/"));
193
194 /** \brief saves the plot properties into a QSettings object.
195 *
196 * This method only saves those properties that differ from their default value.
197 */
198 virtual void saveSettings(QSettings& settings, const QString& group=QString("plots/axes/")) const;
199
200
201 /** \brief return x-pixel coordinate from x coordinate */
202 inline double x2p(double x) const {
203 double r=0;
204 if (logAxis) {
205 if (x<=0) r= offset+scaleSign*log(axismin)/log(logAxisBase)*scale;
206 else r= offset+scaleSign*log(x)/log(logAxisBase)*scale;
207 } else {
208 r= offset+scaleSign*x*scale;
209 }
210 if (inverted) {
211 return 2.0*getParentPlotOffset()+getParentPlotWidth()-r;//getParentPlotOffset()+getParentPlotWidth()-(r-getParentPlotOffset());
212 } else {
213 return r;
214 }
215 }
216
217 /** \brief return x coordinate from x-pixel */
218 inline double p2x(double x) const {
219 double xx=x;
220 if (inverted) {
221 xx=2.0*getParentPlotOffset()+getParentPlotWidth()-x;
222 }
223 xx=xx-offset;
224 if (logAxis) {
225 return exp(log(logAxisBase)*(xx)/(scaleSign*scale));
226 } else {
227 return xx/(scaleSign*scale);
228 }
229 }
230
231
232 /** \brief clear axis tick labels. This switches back to automatic labels mode for the axis. */
234
235 /** \brief add a new tick label to the axis */
236 void addAxisTickLabel(double x, const QString& label);
237
238
239 /** \brief add a new tick label to the axis */
240 void addAxisTickLabels(const QVector<double>& x, const QStringList& label);
241 /** \brief add a new tick label to the axis */
242 void addAxisTickLabels(const double* x, const QStringList& label);
243 /** \brief add a new tick label to the axis */
244 void addAxisTickLabels(const QVector<double>& x, const QString* label);
245 /** \brief add a new tick label to the axis */
246 void addAxisTickLabels(const double* x, const QString* label, int items);
247
248
249 /** \brief return value type for getSize1() and getSize2() */
251 inline AxisElementsSizeDescription(double _requiredSize=0.0, double _elongateMin=0.0, double _elongateMax=0.0): requiredSize(_requiredSize), elongateMin(_elongateMin), elongateMax(_elongateMax) {}
252
253 /** \brief required space, starting at the axis line, in outward direction [pixels] */
255 /** \brief extra space on the min (horizontal: left, vertical: bottom) side BESIDE the axis, e.g. when labels elongate to the left/right or top/bottom of the plot rectangle [pixels] */
257 /** \brief extra space on the max (horizontal: right, vertical: top) side BESIDE the axis, e.g. when labels elongate to the left/right or top/bottom of the plot rectangle [pixels] */
259 };
260
261 /** \brief returns the sizerequirement of the left/bottom axis in pixels
262 *
263 * \param painter a JKQTPEnhancedPainter to use for determining sizes (the same that would be used for drawing!)
264 *
265 * \returns size of the additional space outside the plot rectangle, required for the axis.
266 */
268
269 /** \brief returns the size of the right/top axis in pixels
270 *
271 * \param painter a JKQTPEnhancedPainter to use for determining sizes (the same that would be used for drawing!)
272 *
273 * \returns size of the additional space outside the plot rectangle, required for the axis.
274 */
276
277 /** \brief draw the axes
278 *
279 * \param painter the painter to use for drawing
280 * \param move1 offset in pixels on the major side (horizontal: bottom, vertical: left)
281 * \param move2 offset in pixels on the secondary side (horizontal: top, vertical: right)
282 */
283 virtual void drawAxes(JKQTPEnhancedPainter& painter, int move1=0, int move2=0)=0;
284
285 /** \brief draw grids */
286 virtual void drawGrids(JKQTPEnhancedPainter& painter)=0;
287
288
289 /** \copydoc tickSpacing */
290 inline double getTickSpacing() const { return this->tickSpacing; }
291 /** \copydoc JKQTPCoordinateAxisStyle::labelDigits */
292 inline int getLabelDigits() const { return this->axisStyle.labelDigits; }
293 /** \copydoc autoAxisSpacing */
294 inline bool getAutoAxisSpacing() const { return this->autoAxisSpacing; }
295 /** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelsEnabled */
296 inline bool getMinorTickLabelsEnabled() const { return this->axisStyle.minorTickLabelsEnabled; }
297 /** \copydoc logAxis */
298 inline bool getLogAxis() const { return this->logAxis; }
299 /** \copydoc inverted */
300 inline bool getInverted() const { return this->inverted; }
301 /** \copydoc logAxisBase */
302 inline double getLogAxisBase() const { return this->logAxisBase; }
303 /** \copydoc userTickSpacing */
304 inline double getUserTickSpacing() const { return this->userTickSpacing; }
305 /** \copydoc userLogTickSpacing */
306 inline double getUserLogTickSpacing() const { return this->userLogTickSpacing; }
307 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelType */
308 inline JKQTPCALabelType getTickLabelType() const { return this->axisStyle.tickLabelType; }
309 /** \copydoc axisLabel */
310 inline QString getAxisLabel() const { return this->axisLabel; }
311 /** \copydoc tickUnitFactor */
312 inline double getTickUnitFactor() const { return this->tickUnitFactor; }
313 /** \copydoc tickUnitName */
314 inline QString getTickUnitName() const { return this->tickUnitName; }
315 /** \copydoc JKQTPCoordinateAxisStyle::labelPosition */
316 inline JKQTPLabelPosition getLabelPosition() const { return this->axisStyle.labelPosition; }
317 /** \copydoc JKQTPCoordinateAxisStyle::labelFontSize */
318 inline double getLabelFontSize() const { return this->axisStyle.labelFontSize; }
319 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelFontSize */
320 inline double getTickLabelFontSize() const { return this->axisStyle.tickLabelFontSize; }
321 /** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelFontSize */
322 inline double getMinorTickLabelFontSize() const { return this->axisStyle.minorTickLabelFontSize; }
323 /** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelFullNumber */
324 inline bool getMinorTickLabelFullNumber() const { return this->axisStyle.minorTickLabelFullNumber; }
325 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelAngle */
326 inline double getTickLabelAngle() const { return this->axisStyle.tickLabelAngle; }
327 /** \copydoc JKQTPCoordinateAxisStyle::minTicks */
328 inline unsigned int getMinTicks() const { return this->axisStyle.minTicks; }
329 /** \copydoc JKQTPCoordinateAxisStyle::minorTicks */
330 inline unsigned int getMinorTicks() const { return this->axisStyle.minorTicks; }
331 /** \copydoc JKQTPCoordinateAxisStyle::tickOutsideLength */
332 inline double getTickOutsideLength() const { return this->axisStyle.tickOutsideLength; }
333 /** \copydoc JKQTPCoordinateAxisStyle::arrowSizeFactor */
334 inline double getArrowSizeFactor() const { return this->axisStyle.arrowSizeFactor; }
335 /** \copydoc JKQTPCoordinateAxisStyle::minorTickOutsideLength */
336 inline double getMinorTickOutsideLength() const { return this->axisStyle.minorTickOutsideLength; }
337 /** \copydoc JKQTPCoordinateAxisStyle::axisColor */
338 inline QColor getAxisColor() const { return this->axisStyle.axisColor; }
339 /** \copydoc JKQTPCoordinateAxisStyle::labelColor */
340 inline QColor getLabelColor() const { return this->axisStyle.labelColor; }
341 /** \copydoc JKQTPCoordinateAxisStyle::minorTickColor */
342 inline QColor getMinorTickColor() const { return this->axisStyle.minorTickColor; }
343 /** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelColor */
344 inline QColor getMinorTickLabelColor() const { return this->axisStyle.minorTickLabelColor; }
345 /** \copydoc JKQTPCoordinateAxisStyle::tickColor */
346 inline QColor getTickColor() const { return this->axisStyle.tickColor; }
347 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelColor */
348 inline QColor getTickLabelColor() const { return this->axisStyle.tickLabelColor; }
349 /** \copydoc JKQTPCoordinateAxisStyle::showZeroAxis */
350 inline bool getShowZeroAxis() const { return this->axisStyle.showZeroAxis; }
351 /** \copydoc JKQTPGridStyle::lineColor */
352 inline QColor getGridColor() const { return this->axisStyle.majorGridStyle.lineColor; }
353 /** \copydoc JKQTPGridStyle::lineColor */
354 inline QColor getMinorGridColor() const { return this->axisStyle.minorGridStyle.lineColor; }
355 /** \copydoc JKQTPGridStyle::lineWidth */
356 inline double getGridWidth() const { return this->axisStyle.majorGridStyle.lineWidth; }
357 /** \copydoc JKQTPGridStyle::lineStyle */
358 inline Qt::PenStyle getGridStyle() const { return this->axisStyle.majorGridStyle.lineStyle; }
359 /** \copydoc JKQTPGridStyle::lineWidth */
360 inline double getMinorGridWidth() const { return this->axisStyle.minorGridStyle.lineWidth; }
361 /** \copydoc JKQTPGridStyle::lineStyle */
362 inline Qt::PenStyle getMinorGridStyle() const { return this->axisStyle.minorGridStyle.lineStyle; }
363 /** \copydoc JKQTPCoordinateAxisStyle::tickTimeFormat */
364 inline QString getTickTimeFormat() const { return this->axisStyle.tickTimeFormat; }
365 /** \copydoc JKQTPCoordinateAxisStyle::tickDateFormat */
366 inline QString getTickDateFormat() const { return this->axisStyle.tickDateFormat; }
367 /** \copydoc JKQTPCoordinateAxisStyle::tickDateTimeFormat */
368 inline QString getTickDateTimeFormat() const { return this->axisStyle.tickDateTimeFormat; }
369 /** \copydoc JKQTPCoordinateAxisStyle::tickPrintfFormat */
370 inline QString getTickPrintfFormat() const { return this->axisStyle.tickPrintfFormat; }
371 /** \copydoc JKQTPCoordinateAxisStyle::tickMode */
372 inline JKQTPLabelTickMode getTickMode() const { return this->axisStyle.tickMode; }
373#if __cplusplus >= 202002L || DOXYGEN
374# if defined(__cpp_lib_format) || DOXYGEN
375 /** \copydoc JKQTPCoordinateAxisStyle::tickFormatFormat */
376 inline QString getTickFormatfFormat() const { return this->axisStyle.tickFormatFormat; }
377# endif
378#endif
379
380 /** \copydoc JKQTPCoordinateAxisStyle::drawMode0 */
381 inline JKQTPCADrawMode getDrawMode0() const { return this->axisStyle.drawMode0; }
382 /** \copydoc JKQTPCoordinateAxisStyle::drawMode1 */
383 inline JKQTPCADrawMode getDrawMode1() const { return this->axisStyle.drawMode1; }
384 /** \copydoc JKQTPCoordinateAxisStyle::drawMode2 */
385 inline JKQTPCADrawMode getDrawMode2() const { return this->axisStyle.drawMode2; }
386 /** \copydoc JKQTPCoordinateAxisStyle::minorTickWidth */
387 inline double getMinorTickWidth() const { return this->axisStyle.minorTickWidth; }
388 /** \copydoc JKQTPCoordinateAxisStyle::tickWidth */
389 inline double getTickWidth() const { return this->axisStyle.tickWidth; }
390 /** \copydoc JKQTPCoordinateAxisStyle::lineWidth */
391 inline double getLineWidth() const { return this->axisStyle.lineWidth; }
392 /** \copydoc JKQTPCoordinateAxisStyle::lineWidthZeroAxis */
393 inline double getLineWidthZeroAxis() const { return this->axisStyle.lineWidthZeroAxis; }
394 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelDistance */
395 inline double getTickLabelDistance() const { return this->axisStyle.tickLabelDistance; }
396 /** \copydoc JKQTPCoordinateAxisStyle::labelDistance */
397 inline double getLabelDistance() const { return this->axisStyle.labelDistance; }
398 /** \copydoc JKQTPGridStyle::enabled */
399 inline bool getDrawGrid() const { return this->axisStyle.majorGridStyle.enabled; }
400 /** \copydoc JKQTPGridStyle::enabled */
401 inline bool getDrawMinorGrid() const { return this->axisStyle.minorGridStyle.enabled; }
402 /** \copydoc JKQTPCoordinateAxisStyle::autoLabelDigits */
403 inline void setAutoLabelDigits(bool __value)
404 {
405 this->axisStyle.autoLabelDigits = __value;
406 }
407 /** \copydoc JKQTPCoordinateAxisStyle::autoLabelDigits */
408 inline bool getAutoLabelDigits() const
409 {
410 return this->axisStyle.autoLabelDigits;
411 }
412 /** \copydoc parent */
413 inline const JKQTBasePlotter* getParent() const { return this->parent; }
414 /** \copydoc parent */
415 inline JKQTBasePlotter* getParent() { return this->parent; }
416 /** \copydoc doUpdateScaling */
417 inline void setDoUpdateScaling(bool __value)
418 {
419 this->doUpdateScaling = __value;
420 }
421 /** \copydoc doUpdateScaling */
422 inline bool getDoUpdateScaling() const
423 {
424 return this->doUpdateScaling;
425 }
426
427
428 /** \brief returns the current min */
429 inline double getMin() const {return axismin; }
430
431 /** \brief returns the current max */
432 inline double getMax() const {return axismax; }
433
434 /** \brief returns whether the axis range is fixed, i.e. may not change! */
435 inline bool isAxisRangeFixed() const {return axisRangeFixed; }
436
437 /** \brief returns the current absolute min */
438 inline double getAbsoluteMin() const {return axisabsoultemin; }
439
440 /** \brief returns the current absolute max */
441 inline double getAbsoluteMax() const {return axisabsoultemax; }
442 /** \brief calculate the scaling and offset values from axis min/max values
443 *
444 * This is only executed when \c paramChanged==true, as otherwise the data has to be still
445 * correct. recalculating may be forced by caling calcPlotScaing(true);
446 */
447 void calcPlotScaling(bool force=false);
448
449 /** \brief returns whether this axis uses logarithmic scaling */
450 bool isLogAxis() const;
451
452 /** \brief returns whether this axis uses linear scaling (is false e.g. for isLogAxis()==true) */
453 bool isLinearAxis() const;
454
455
456 /** \brief current style properties for this JKQTBasePlotter
457 *
458 * \see JKQTPSetSystemDefaultBaseStyle(), JKQTPSetSystemDefaultBaseStyle(), setCurrentAxisStyle(), getCurrentAxisStyle(), \ref jkqtpplotter_styling
459 */
461
462 /** \brief replace the current style properties for this JKQTBasePlotter
463 *
464 * \see JKQTPSetSystemDefaultBaseStyle(), JKQTPSetSystemDefaultBaseStyle(), setCurrentAxisStyle(), getCurrentAxisStyle(), \ref jkqtpplotter_styling
465 */
467 /** \brief replace the current style properties for this JKQTBasePlotter with properties loaded from \a settings
468 *
469 * \param settings the QSettings object to read from
470 * \param group group in \a settings to read from
471 *
472 * \see JKQTPCoordinateAxisStyle getCurrentAxisStyle(), \ref jkqtpplotter_styling
473 */
474 void loadCurrentAxisStyle(const QSettings& settings, const QString& group="plot/axes/");
475 /** \brief store the current style properties for this JKQTBasePlotter with properties loaded from \a settings
476 *
477 * \param settings the QSettings object to write to
478 * \param group group in \a settings to write to
479 *
480 * \see JKQTPSetSystemDefaultBaseStyle(), JKQTPSetSystemDefaultBaseStyle(), setCurrentAxisStyle(), getCurrentAxisStyle(), \ref jkqtpplotter_styling
481 */
482 void saveCurrentAxisStyle(QSettings& settings, const QString& group="plot/axes/") const;
483
484 /** \brief width of the plot in the direction of the axis */
485 virtual double getParentPlotWidth() const=0;
486 /** \brief offset of the plot in the direction of the axis */
487 virtual double getParentPlotOffset() const=0;
488 /** \brief width of other (perpendicular) axis (needed for grids) */
489 virtual double getParentOtheraxisWidth() const=0;
490 /** \brief is other (perpendicular) axis inverted (needed for grids) */
491 virtual bool getParentOtheraxisInverted() const=0;
492 /** \brief pixel offset of (perpendicular) other axis (needed for grids) */
493 virtual double getParentOtheraxisOffset() const=0;
494 /** \brief calls x2p() of the other axis (or returns \c NAN if the other axis does not exist */
495 virtual double parentOtherAxisX2P(double x) const =0;
496
497 /** \brief convert a float to a tick label string */
498 QString floattolabel(double data) const;
499
500 /** \brief convert a float to a tick label string with a given precision */
501 QString floattolabel(double data, int past_comma) const;
502
503 public Q_SLOTS:
504 /** \brief set range of plot axis
505 *
506 * \param amin new minimum
507 * \param amax new maximum
508 *
509 * \note the actually set range may differ from [amin...amax] in order to fullfill requirements e.g. for logarithmic axes or an absolute axis range (see setAbsoluteRange() )
510 * \note if setRangeFixed(true) was called before this call, the axis range is fixed and this function has NO EFFECT!
511 */
512 void setRange(double amin, double amax);
513 /** \brief set axis minimum range of plot axis
514 *
515 * \param amin new minimum
516 *
517 * \note the actually set range may differ from [amin...getMax()] in order to fullfill requirements e.g. for logarithmic axes or an absolute axis range (see setAbsoluteRange() )
518 * \note if setRangeFixed(true) was called before this call, the axis range is fixed and this function has NO EFFECT!
519 */
520 void setMin(double amin);
521 /** \brief set axis minimum range of plot axis
522 *
523 * \param amax new maximum
524 *
525 * \note the actually set range may differ from [getMin()...amax] in order to fullfill requirements e.g. for logarithmic axes or an absolute axis range (see setAbsoluteRange() )
526 * \note if setRangeFixed(true) was called before this call, the axis range is fixed and this function has NO EFFECT!
527 */
528 void setMax(double amax);
529 /** \brief fixes/ufixes the axis
530 *
531 * a fixed axis's range (minimum/maximum) may not be changed by the user!)
532 */
533 void setRangeFixed(bool fixed);
534 /** \brief sets absolutely limiting range of the plot
535 *
536 * The user (or programmer) cannot zoom to a viewport that is larger than the range given to this function.
537 *
538 * \param aamin absolute minimum of the axis
539 * \param aamax absolute maximum of the axis
540 *
541 * \note if the aspect ratio (set in the JKQTBasePlotter or JKQTPlotter) of this does not fit into the widget, it is possible that you don't see the complete contents!
542 *
543 * \see setAbsoluteX(), setAbsoluteY(), zoomToFit(), JKQTPCoordinateAxis::setAbsoluteRange()
544 */
545 void setAbsoluteRange(double aamin, double aamax);
546 /** \brief do not use an absolute range of plot axis */
548
549 /** \copydoc axisMinWidth */
550 void setAxisMinWidth(double __value);
551
552 /** \copydoc autoAxisSpacing */
553 void setAutoAxisSpacing(bool __value);
554
555 /** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelsEnabled */
556 void setMinorTickLabelsEnabled(bool __value);
557
558 /** \copydoc logAxis */
559 void setLogAxis(bool __value) ;
560
561 /** \copydoc logAxisBase */
562 void setLogAxisBase (double __value);
563
564 /** \copydoc userTickSpacing */
565 void setUserTickSpacing (double __value);
566
567 /** \copydoc userLogTickSpacing */
568 void setUserLogTickSpacing (double __value);
569
570 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelType */
572
573 /** \copydoc JKQTPCoordinateAxisStyle::tickMode */
575 /** \copydoc JKQTPCoordinateAxisStyle::tickMode */
576 void setTickMode (int __value);
577
578 /** \copydoc axisLabel */
579 void setAxisLabel (const QString& __value);
580
581 /** \copydoc tickUnitName */
582 void setTickUnitName(const QString& __value);
583
584 /** \copydoc tickUnitFactor */
585 void setTickUnitFactor(double __value);
586 /** \brief sets tickUnitFactor and tickUnitName in one call
587 *
588 * \see calls setTickUnitName() and setTickUnitFactor()
589 */
590 void setTickUnit(double factor, const QString& name);
591 /** \brief sets pi-scaling for tickUnitFactor and tickUnitName in one call
592 *
593 * \image html axisstyle/axis_unit_scaling_pi.png
594 * \see calls setTickUnitName() and setTickUnitFactor()
595 */
597 /** \brief resets tickUnitFactor and tickUnitName in one call
598 *
599 * \see calls setTickUnit(), setTickUnitName() and setTickUnitFactor()
600 */
602
603 /** \copydoc JKQTPCoordinateAxisStyle::labelPosition */
605
606 /** \copydoc JKQTPCoordinateAxisStyle::labelFontSize */
607 void setLabelFontSize (double __value);
608
609 /** \copydoc JKQTPCoordinateAxisStyle::tickTimeFormat */
610 void setTickTimeFormat (const QString& __value);
611
612 /** \copydoc JKQTPCoordinateAxisStyle::tickDateFormat */
613 void setTickDateFormat (const QString& __value);
614
615
616 /** \copydoc JKQTPCoordinateAxisStyle::tickDateTimeFormat */
617 void setTickDateTimeFormat (const QString& __value);
618
619 /** \copydoc JKQTPCoordinateAxisStyle::tickPrintfFormat */
620 void setTickPrintfFormat(const QString& __value);
621#if __cplusplus >= 202002L || DOXYGEN
622# if defined(__cpp_lib_format) || DOXYGEN
623 /** \copydoc JKQTPCoordinateAxisStyle::tickFormatFormat */
624 void setTickFormatFormat(const QString& __value);
625# endif
626#endif
627 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelFontSize */
628 void setTickLabelFontSize (double __value);
629
630 /** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelFontSize */
631 void setMinorTickLabelFontSize (double __value);
632
633 /** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelFullNumber */
634 void setMinorTickLabelFullNumber (bool __value);
635
636 /** \copydoc JKQTPCoordinateAxisStyle::minTicks */
637 void setMinTicks(unsigned int __value);
638
639 /** \copydoc JKQTPCoordinateAxisStyle::minorTicks */
640 void setMinorTicks (unsigned int __value);
641
642 /** \copydoc JKQTPCoordinateAxisStyle::minorTicks */
643 void setMinorTicks (int __value);
644
645 /** \copydoc JKQTPCoordinateAxisStyle::tickOutsideLength */
646 void setTickOutsideLength(double __value);
647
648 /** \copydoc JKQTPCoordinateAxisStyle::minorTickOutsideLength */
649 void setMinorTickOutsideLength (double __value);
650
651 /** \copydoc JKQTPCoordinateAxisStyle::tickInsideLength */
652 void setTickInsideLength(double __value);
653
654 /** \copydoc JKQTPCoordinateAxisStyle::minorTickInsideLength */
655 void setMinorTickInsideLength (double __value);
656
657 /** \copydoc JKQTPCoordinateAxisStyle::axisColor */
658 void setAxisColor (const QColor& __value);
659
660 /** \copydoc JKQTPCoordinateAxisStyle::showZeroAxis */
661 void setShowZeroAxis(bool __value);
662
663 /** \copydoc inverted */
664 void setInverted(bool __value);
665
666 /** \copydoc JKQTPGridStyle::lineColor */
667 void setGridColor(const QColor& __value);
668 /** \copydoc JKQTPGridStyle::lineColor */
669 void setGridColor(const QColor& __value, double alpha);
670
671 /** \copydoc JKQTPGridStyle::lineColor */
672 void setMinorGridColor(const QColor& __value);
673 /** \copydoc JKQTPGridStyle::lineColor */
674 void setMinorGridColor(const QColor& __value, double alpha);
675
676 /** \copydoc JKQTPGridStyle::lineWidth */
677 void setGridWidth (double __value);
678
679 /** \copydoc JKQTPGridStyle::lineStyle */
680 void setGridStyle(Qt::PenStyle __value);
681
682 /** \copydoc JKQTPGridStyle::lineWidth */
683 void setMinorGridWidth(double __value);
684
685 /** \copydoc JKQTPGridStyle::lineStyle */
686 void setMinorGridStyle (Qt::PenStyle __value);
687
688
689 /** \copydoc JKQTPCoordinateAxisStyle::drawMode1 */
691 /** \copydoc JKQTPCoordinateAxisStyle::drawMode0 */
693
694 /** \copydoc JKQTPCoordinateAxisStyle::drawMode2 */
696
697 /** \copydoc JKQTPCoordinateAxisStyle::minorTickWidth */
698 void setMinorTickWidth(double __value);
699
700 /** \copydoc JKQTPCoordinateAxisStyle::tickWidth */
701 void setTickWidth (double __value);
702
703 /** \copydoc JKQTPCoordinateAxisStyle::lineWidth */
704 void setLineWidth (double __value);
705
706 /** \copydoc JKQTPCoordinateAxisStyle::lineWidthZeroAxis */
707 void setLineWidthZeroAxis (double __value);
708
709 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelDistance */
710 void setTickLabelDistance(double __value);
711
712 /** \copydoc JKQTPCoordinateAxisStyle::labelDistance */
713 void setLabelDistance(double __value);
714 /** \copydoc JKQTPCoordinateAxisStyle::labelDigits */
715 void setLabelDigits(int __value);
716
717 /** \copydoc JKQTPGridStyle::enabled */
718 void setDrawGrid(bool __value);
719
720 /** \copydoc JKQTPGridStyle::enabled */
721 void setDrawMinorGrid(bool __value);
722
723
724 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelAngle */
725 void setTickLabelAngle(double __value);
726 /** \copydoc JKQTPCoordinateAxisStyle::arrowSizeFactor */
727 void setArrowSizeFactor(double f) ;
728 /** \copydoc JKQTPCoordinateAxisStyle::labelColor */
729 void setLabelColor(QColor c) ;
730 /** \copydoc JKQTPCoordinateAxisStyle::minorTickColor */
731 void setMinorTickColor(QColor c) ;
732 /** \copydoc JKQTPCoordinateAxisStyle::minorTickLabelColor */
733 void setMinorTickLabelColor(QColor c) ;
734 /** \copydoc JKQTPCoordinateAxisStyle::tickColor */
735 void setTickColor(QColor c);
736 /** \copydoc JKQTPCoordinateAxisStyle::tickLabelColor */
737 void setTickLabelColor(QColor c) ;
738 /** \brief sets all colors (line, ticks, label, ...) of the axis */
739 void setColor(QColor c) ;
740
741 protected:
743 inline Axis0ElementsSizeDescription(double _requiredSize=0.0, double _requiredSizeOpposite=0.0, double _elongateMin=0.0, double _elongateMax=0.0): AxisElementsSizeDescription(_requiredSize, _elongateMin, _elongateMax), requiredSizeOpposite(_requiredSizeOpposite) {}
744 /** \brief additional size, required for the axis, in the opposite direction as AxisElementsSizeDescription::requiredSize */
746 inline double maxRequiredSize() const {
747 return qMax(requiredSize,requiredSizeOpposite);
748 }
749 };
750
751 /** \brief returns the size of the zero axis in pixels, the first part of the return-value is the lhs size and the second part the rhs size */
753 /** \brief indicates whether one of the parameters has changed sinse the last recalculation of tickSpacing ... */
755 /** \brief can be used to switch off calcPlotScaling() temporarily, while modifying some properties
756 *
757 * use setDoUpdateScaling() to set this property
758 *
759 * \see setDoUpdateScaling() and getDoUpdateScaling()
760 */
762
763 /** \brief simply calls the redrawPlot method of the parent plotter class */
765 /** \brief a list of tick labels.
766 *
767 * If this list contains items, this class will NOT plot a standard x-axis,
768 * but only mark the positions in this list. Every item is a x-position together with
769 * the label to be plotted there. The label may contain LaTeX markup.
770 */
771 QVector<QPair<double, QString> > tickLabels;
772 /** \brief retun parents JKQTMathText* object */
774 /** \brief retun parents JKQTMathText* object */
776
777
778 /** \brief parent plotter class */
780 /** \brief current view: minimum of axis */
781 double axismin;
782 /** \brief current view: maximum of axis */
783 double axismax;
784 /** \brief indicates whether this axis is fixed, i.e. axismin and axismax are frozen to their current values */
786
787 /** \brief absoulte minimum of axis (axismin/axismax xan not be set below this) */
789 /** \brief absoulte maximum of axis (axismin/axismax xan not be set above this) */
791
792
793 /** \brief current style properties for this coordinate axis instance
794 *
795 * \see JKQTBasePlotterStyle, JKQTPSetSystemDefaultBaseStyle(), JKQTPSetSystemDefaultBaseStyle(), setCurrentAxisStyle(), getCurrentAxisStyle(), \ref jkqtpplotter_styling
796 */
798
799 /** \brief absolute minimum range width, feature switched off when <0 */
801
802 /** \brief <b>calculated property:</b> width of plot on axis (calculated by calcPlotScaling() )
803 *
804 * \see calcPlotScaling(), calcTickSpacing()
805 */
806 double width;
807
808 /** \brief <b>calculated property:</b> axis scaling factor (calculated by calcPlotScaling() )
809 *
810 * \see calcPlotScaling(), calcTickSpacing()
811 */
812 double scale;
813 /** \brief <b>calculated property:</b> axis offset (calculated by calcPlotScaling() )
814 *
815 * \see calcPlotScaling(), calcTickSpacing()
816 */
817 double offset;
818 /** \brief indicates whether the axis is to be inverted or not
819 *
820 * \image html jkqtplotter_inverted_yaxis.png
821 */
823
824 /** \brief <b>calculated property:</b> x position of the first tick (calculated by calcPlotScaling() ). Given in system coordinates, not pixel coordinates.
825 *
826 * \see calcPlotScaling(), calcTickSpacing()
827 */
828 double tickStart;
829
830 /** \brief <b>calculated property:</b> indicates whether the object should use automatic tick spacing for the x axis (calculated by calcPlotScaling() )
831 *
832 * \see calcPlotScaling(), calcTickSpacing()
833 */
835
836 /** \brief indicates whether the y axis has a logarithmic scale */
838 /** \brief the base for a logarithmic x axis */
840 /** \brief if autoXAxisSpacing is \c false then this value is used for xTickSpacing. So this is the property which
841 * is editable by use of public access methods.
842 */
844 /** \brief if autoXAxisSpacing is \c false then this value is used for xTickSpacing. So this is the property which
845 * is editable by use of public access methods.
846 */
848
849 /** \brief <b>calculated property:</b> axis tick spacing (calculated by calcPlotScaling() and calcTickSpacing() ) for logarithmic/linear axes.
850 *
851 * \see calcPlotScaling(), calcTickSpacing()
852 */
854 /** \brief <b>calculated property:</b> axis tick spacing for logarithmic JKQTPCoordinateAxisStyle::ticks (calculated by calcPlotScaling() and calcTickSpacing() ) axes.
855 *
856 * \see calcPlotScaling()
857 */
859
860
861 /** \brief axis label of the axis */
862 QString axisLabel;
863
864 /** \brief tick values are the actual x/y-coordiniate, divided by this value (e.g. pu \f$ \pi \f$ to have an axis with values <tt>0, pi, 2pi, 3pi ...</tt>) */
866
867 /** \brief name of the factor tickUnitFactor. This string is used in tick-labels to write e.g. \c "2pi" instead of 6.28... */
869
870
871 /** \brief calculates the tick spacing for a linear axis that spans \a awidth and that should
872 * show at least \a JKQTPCoordinateAxisStyle::minTicks JKQTPCoordinateAxisStyle::ticks.
873 *
874 * The <b>algorithm</b> used in here works as follows:
875 *
876 * There is only a limited subset of allowed tick distances. These distances are 1 (resulting in 10 JKQTPCoordinateAxisStyle::ticks per decade, i.e. 0,1,2,3,4,...),
877 * 2 (5 JKQTPCoordinateAxisStyle::ticks/decade, i.e. 0,2,4,...), 2.5 (4 JKQTPCoordinateAxisStyle::ticks/decade, i.e. 0,2.5,5,...) and 5 (2 JKQTPCoordinateAxisStyle::ticks/decade, i.e. 0,5,10,15,...). So the
878 * axis is divided into decades that each is divided into JKQTPCoordinateAxisStyle::ticks, as defined above. With these preconditions the algorithm tries
879 * to find a tick increment \f$ \Delta\mbox{tick} \f$ which is one of the above distances multiplied by a power \f$ \rho \f$ of 10.
880 * This increment is determined in a way, that the axis contains at least \a JKQTPCoordinateAxisStyle::minTicks JKQTPCoordinateAxisStyle::ticks:
881 * \f[ \Delta\mbox{tick}=f\cdot 10^\rho,\ \ \ \ \ f\in\{1, 2, 2.5, 5\} \f]
882 *
883 * -# The algorithm starts by finding a start exponent \f$ \rho_s=\left\lfloor\log_{10}(\mbox{awidth})\right\rfloor+3 \f$. This
884 * is a good (over)estimate for the biggest possible power \f$ \rho \f$.
885 * -# now we set \f$ \rho=\rho_0 \f$ and \f$ f=10 \f$.
886 * -# now the algorithm cycles through all possible factors \f$ f\in\{1, 2, 2.5, 5, 10\} \f$ (starting from 10) and calculates
887 * \f$ \Delta\mbox{tick}=f\cdot 10^\rho \f$. Then it checks whether \f$ \mbox{tickcount}=\mbox{round}\left(\frac{\mbox{awidth}}{\Delta\mbox{tick}}\right) \f$
888 * is smaller than \a JKQTPCoordinateAxisStyle::minTicks (if yes the algorithm reached its end and \f$ \Delta\mbox{tick} \f$ can be used.
889 * -# if \f$ f=1 \f$ is reached and checked \c false, then the algorithm decreases the exponent \f$ \rho \leftarrow \rho-1 \f$ and returns to step 3.
890 *
891 */
893 /** \brief same as calcLinearTickSpacing(), but for logarithmic scaling
894 *
895 * \see calcLinearTickSpacing()
896 * */
898
899 /** \brief Calculate the number of digits needed for the labels of an axis that starts at
900 * \a minval and where the tick spacing is \a tickSpacing.
901 *
902 * This method determines how many digits to output for the labels on a coordinate axis.
903 * This is done by testing different digit numbers and comparing subsequent labels. If two labels
904 * are equal, then we need more valid digits to distinguish them.
905 */
907
908
909
910 /** \brief axis prefix for storage of parameters */
911 QString axisPrefix;
912 /** \brief this is used by x2p() and p2x() to determine the sign */
913 double scaleSign;
914
915 /** \brief calculates the next label from the given parameters.
916 *
917 * \return \c true on success and \c false if there is no more label
918 * \param x \b before \b call: the position of the label for which the text should be returned (or JKQTPCoordinateAxisStyle::tickStart for first call),
919 * \b after \b call: position of the next label (given in world coordinates!)
920 * \param label \b after \b call: text of the (input) tick label This is an empty string, if the label is not visible!
921 * \param init call this function with \c init=true to obtain the first label (at JKQTPCoordinateAxisStyle::tickStart)
922 */
923 bool getNextLabel(double& x, QString& label, bool init=false);
924
925 /** \brief returns the distance from the current tick position (x before call) to the next tick position */
926 double getNextLabelDistance(double x);
927
928 /** \brief calculates the maximum width and height (returned as QSize) of all tick labels.
929 * Ascent and descent may also be returned in the two additional pointer arguments- */
930 QSizeF getMaxTickLabelSize(JKQTPEnhancedPainter& painter, double* ascent=nullptr, double* descent=nullptr);
931 /** \brief draw the axis line \a l (pointing from axismin to axismax) optionally decorated as specified by \a drawMode using JKQTPEnhancedPainter \a painter */
932 void drawAxisLine(JKQTPEnhancedPainter& painter, const QLineF& l, JKQTPCADrawMode drawMode) const;
933
934 /** \brief calculate the position of the zero-axis (and whether to draw it or not) */
935 double getZeroAxisPos(bool* drawZeroAxis=nullptr);
936
937 /** \brief figures out (possibly by probing the parent JKQTBasePlotter), whether this axis is a secondary axis */
938 virtual bool isSecondaryAxis() const;
939
940
941};
942
943
944
945
946
947/*! \brief base class for vertical axes, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
948 \ingroup jkqtpbaseplotter_elements
949
950 The positioning of the different axis elements depends on the psition of the "other" axis (i.e. a horizontal/x-axis),
951 i.e. the corresponding vertical axis:
952
953 \image html JKQTPVerticalAxisPositioning.png
954
955 But this "other>" axis is not defined here, but has to be defined in derived classes by immplementing the corresponding
956 pure virtual functions:
957 - getParentPlotWidth()
958 - getParentPlotOffset()
959 - getParentOtheraxisWidth()
960 - getParentOtheraxisInverted()
961 - getParentOtheraxisOffset()
962 - parentOtherAxisX2P()
963 .
964
965 \see JKQTPHorizontalAxisBase
966 */
968 Q_OBJECT
969 protected:
970 public:
971 /** \brief class constructor */
973
974 /** \brief returns the size of the left axis in pixels */
977
978 /** \brief returns the size of the right axis in pixels */
981
982 /** copydoc JKQTPCoordinateAxis::drawAxes() */
983 virtual void drawAxes(JKQTPEnhancedPainter& painter, int move1=0, int move2=0) override;
984
985 /** copydoc JKQTPCoordinateAxis::drawGrids() */
986 virtual void drawGrids(JKQTPEnhancedPainter& painter) override;
987
988
989 protected:
990 /** copydoc JKQTPCoordinateAxis::getSize0() */
992 /** \brief draw a tick label on the left axis 1 with text \a label (with optional rotation) at ( \a xx , \a yy ) (in pixel)
993 *
994 * \param painter the JKQTPEnhancedPainter used for drawing
995 * \param xx the exact position of the tick in pixels
996 * \param yy the exact position of the tick in pixels
997 * \param labelOffset offset of the label from ( \a xx , \a yy ) in pt, this is typically equal to \c tickOuterLength+tickLabelDistance
998 * \param label text to display
999 * \param fontSize the fontSize of the label (in pt)
1000 * \param isMinor indicates whether the axis tick is a minor tick
1001 */
1002 void drawTickLabel1(JKQTPEnhancedPainter& painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, bool isMinor=false) ;
1003 /** \brief draw a tick label on the right axis 2 with text \a label (with optional rotation) at ( \a xx , \a yy ) (in pixel)
1004 *
1005 * \param painter the JKQTPEnhancedPainter used for drawing
1006 * \param xx the exact position of the tick in pixels
1007 * \param yy the exact position of the tick in pixels
1008 * \param labelOffset offset of the label from ( \a xx , \a yy ) in pt, this is typically equal to \c tickOuterLength+tickLabelDistance
1009 * \param label text to display
1010 * \param fontSize the fontSize of the label (in pt)
1011 * \param isMinor indicates whether the axis tick is a minor tick
1012 */
1013 void drawTickLabel2(JKQTPEnhancedPainter& painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, bool isMinor=false) ;
1014 /** \brief draw the axis label using \a painter for axis 1 at \c x= \a left and \c y= \a bottom. \a labelMax is the maximum Size of all tick labels */
1015 void drawAxisLabel1(JKQTPEnhancedPainter &painter, double left, double bottom, QSizeF labelMax, JKQTPCADrawMode drawMode);
1016 /** \brief draw the axis label using \a painter for axis 2 at \c x= \a right and \c y= \a bottom. \a labelMax is the maximum Size of all tick labels */
1017 void drawAxisLabel2(JKQTPEnhancedPainter &painter, double right, double bottom, QSizeF labelMax, JKQTPCADrawMode drawMode);
1018
1019};
1020
1021
1022
1023/*! \brief implements a vertical axis for use as primary, secondary, ... axis of a JKQTPBasePlotter,
1024 * based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
1025 \ingroup jkqtpbaseplotter_elements
1026
1027 The positioning of the different axis elements depends on the psition of the "other" axis (here x-axis),
1028 i.e. the corresponding vertical axis:
1029
1030 \image html JKQTPVerticalAxisPositioning.png
1031 */
1033 Q_OBJECT
1034 protected:
1035 public:
1036 /** \brief class constructor */
1038
1039
1040 /** copydoc JKQTPCoordinateAxis::getParentPlotWidth() */
1041 virtual double getParentPlotWidth() const override;
1042 /** copydoc JKQTPCoordinateAxis::getParentPlotOffset() */
1043 virtual double getParentPlotOffset() const override;
1044 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisWidth() */
1045 virtual double getParentOtheraxisWidth() const override;
1046 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisInverted() */
1047 virtual bool getParentOtheraxisInverted() const override;
1048 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisOffset() */
1049 virtual double getParentOtheraxisOffset() const override;
1050 /** copydoc JKQTPCoordinateAxis::parentOtherAxisX2P() */
1051 virtual double parentOtherAxisX2P(double x) const override;
1052 /** \copydoc otherAxisRef */
1054 /** \brief returns the "other" axis, refernced by otherAxisRef */
1056
1057 protected:
1058
1059 /** \brief references the other axis fromm the JKQTPBasePLotter to use as "other" axis */
1061};
1062
1063
1064/*! \brief implements a position-indipendent vertical axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
1065 \ingroup jkqtpbaseplotter_elements
1066
1067
1068 This axis may be draw at a user-supplied position (used e.g. for color bar axes).
1069 The axis positioning parameters are supplied via the constructor,or setter methods.
1070
1071 \image html JKQTPVerticalIndependentAxisPositioning.png
1072
1073 Basically this class overwrites several virtual methods as follows:
1074 - getParentPlotWidth() returns axisWidth, provided in the connstructor or via setParentPlotWidth()
1075 - getParentPlotOffset() returns axisOffset, provided in the connstructor or via setParentPlotOffset()
1076 - getParentOtheraxisWidth() returns otherAxisWidth, provided in the connstructor or via setParentPlotOtheraxisWidth()
1077 - getParentOtheraxisOffset() returns otherAxisOffset, provided in the connstructor or via setParentPlotOtheraxisOffset()
1078 .
1079
1080 If it is paired with another axis, the parameters of that axis have to be given explizitly in the constructor or with setters.
1081
1082 */
1084 Q_OBJECT
1085 protected:
1086 public:
1087 /** \brief class constructor */
1088 JKQTPVerticalIndependentAxis(double axisOffset, double axisWidth, double otherAxisOffset, double otherAxisWidth, JKQTBasePlotter* parent);
1089
1090 /** copydoc JKQTPCoordinateAxis::getParentPlotWidth() */
1091 virtual double getParentPlotWidth() const override;
1092 /** copydoc JKQTPCoordinateAxis::getParentPlotOffset() */
1093 virtual double getParentPlotOffset() const override;
1094 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisWidth() */
1095 virtual double getParentOtheraxisWidth() const override;
1096 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisInverted() */
1097 virtual bool getParentOtheraxisInverted() const override;
1098 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisOffset() */
1099 virtual double getParentOtheraxisOffset() const override;
1100 /** copydoc JKQTPCoordinateAxis::parentOtherAxisX2P() */
1101 virtual double parentOtherAxisX2P(double x) const override;
1102
1103 /** copydoc JKQTPCoordinateAxis::drawAxes() */
1104 virtual void drawAxes(JKQTPEnhancedPainter& painter, int move1=0, int move2=0) override;
1105
1106 public Q_SLOTS:
1107 /** \brief set the axis offset */
1108 virtual void setAxisOffset(double __value) ;
1109 /** \brief set the axis width */
1110 virtual void setAxisWidth(double __value) ;
1111 /** \brief set the other axis offset */
1112 virtual void setOtherAxisOffset(double __value) ;
1113 /** \brief set the other axis width */
1114 virtual void setOtherAxisWidth(double __value) ;
1115 /** \brief set whether the other axis is inverted */
1116 virtual void setOtherAxisInverted(bool __value) ;
1117
1118 protected:
1119 /** \brief the offset of the axis */
1121 /** \brief the width of the axis */
1123 /** \brief the width of the other axis */
1125 /** \brief the offset of the other axis */
1127 /** \brief indicates whether the other axis is inverted */
1129};
1130
1131
1132
1133/*! \brief base class for horizontal axes, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
1134 \ingroup jkqtpbaseplotter_elements
1135
1136 The positioning of the different axis elements depends on the psition of the "other" axis (i.e. a vertical/y-axis),
1137 i.e. the corresponding vertical axis:
1138
1139 \image html JKQTPHorizontalAxisPositioning.png
1140
1141
1142 But this "other>" axis is not defined here, but has to be defined in derived classes by immplementing the corresponding
1143 pure virtual functions:
1144 - getParentPlotWidth()
1145 - getParentPlotOffset()
1146 - getParentOtheraxisWidth()
1147 - getParentOtheraxisInverted()
1148 - getParentOtheraxisOffset()
1149 - parentOtherAxisX2P()
1150 .
1151
1152 \see JKQTPVerticalAxisBase
1153 */
1155 Q_OBJECT
1156 protected:
1157 public:
1158 /** \brief class constructor */
1160
1161 /** \brief returns the size of the bottom axis in pixels */
1164
1165 /** \brief returns the size of the top axis in pixels */
1168
1169 /** copydoc JKQTPCoordinateAxis::drawAxes() */
1170 virtual void drawAxes(JKQTPEnhancedPainter& painter, int move1=0, int move2=0) override;
1171
1172 /** copydoc JKQTPCoordinateAxis::drawGrids() */
1173 virtual void drawGrids(JKQTPEnhancedPainter& painter) override;
1174
1175
1176 protected:
1177 /** copydoc JKQTPCoordinateAxis::getSize0() */
1179 /** \brief draw a tick label on the lower axis 1 with text \a label (with optional rotation) at ( \a xx , \a yy ) (in pixel)
1180 *
1181 * \param painter the JKQTPEnhancedPainter used for drawing
1182 * \param xx the exact position of the tick in pixels
1183 * \param yy the exact position of the tick in pixels
1184 * \param labelOffset offset of the label from ( \a xx , \a yy ) in pt, this is typically equal to \c tickOuterLength+tickLabelDistance
1185 * \param label text to display
1186 * \param fontSize the fontSize of the label (in pt)
1187 * \param ascentMax maximum ascent of all tick labels
1188 * \param descentMax maximum descent of all tick labels
1189 * \param isMinor indicates whether the axis tick is a minor tick
1190 */
1191 void drawTickLabel1(JKQTPEnhancedPainter& painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, double ascentMax, double descentMax, bool isMinor=false) ;
1192 /** \brief draw a tick label on the upper axis 2 with text \a label (with optional rotation) at ( \a xx , \a yy ) (in pixel)
1193 *
1194 * \param painter the JKQTPEnhancedPainter used for drawing
1195 * \param xx the exact position of the tick in pixels
1196 * \param yy the exact position of the tick in pixels
1197 * \param labelOffset offset of the label from ( \a xx , \a yy ) in pt, this is typically equal to \c tickOuterLength+tickLabelDistance
1198 * \param label text to display
1199 * \param fontSize the fontSize of the label (in pt)
1200 * \param ascentMax maximum ascent of all tick labels
1201 * \param descentMax maximum descent of all tick labels
1202 * \param isMinor indicates whether the axis tick is a minor tick
1203 */
1204 void drawTickLabel2(JKQTPEnhancedPainter& painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, double ascentMax, double descentMax, bool isMinor=false) ;
1205 /** \brief draw the axis label using \a painter for axis 1 at \c x= \a left and \c y= \a bottom. \a labelMax is the maximum Size of all tick labels */
1206 void drawAxisLabel1(JKQTPEnhancedPainter &painter, double left, double bottom, QSizeF labelMax, JKQTPCADrawMode drawMode);
1207 /** \brief draw the axis label using \a painter for axis 2 at \c x= \a left and \c y= \a top. \a labelMax is the maximum Size of all tick labels */
1208 void drawAxisLabel2(JKQTPEnhancedPainter &painter, double left, double top, QSizeF labelMax, JKQTPCADrawMode drawMode);
1209
1210};
1211
1212
1213/*! \brief implements a horizontal axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
1214 \ingroup jkqtpbaseplotter_elements
1215
1216 The positioning of the different axis elements depends on the psition of the "other" axis (here y-axis),
1217 i.e. the corresponding vertical axis:
1218
1219 \image html JKQTPHorizontalAxisPositioning.png
1220 */
1222 Q_OBJECT
1223 protected:
1224 public:
1225 /** \brief class constructor */
1227
1228 /** copydoc JKQTPCoordinateAxis::getParentPlotWidth() */
1229 virtual double getParentPlotWidth() const override;
1230 /** copydoc JKQTPCoordinateAxis::getParentPlotOffset() */
1231 virtual double getParentPlotOffset() const override;
1232 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisWidth() */
1233 virtual double getParentOtheraxisWidth() const override;
1234 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisInverted() */
1235 virtual bool getParentOtheraxisInverted() const override;
1236 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisOffset() */
1237 virtual double getParentOtheraxisOffset() const override;
1238 /** copydoc JKQTPCoordinateAxis::parentOtherAxisX2P() */
1239 virtual double parentOtherAxisX2P(double x) const override;
1240 /** \copydoc otherAxisRef */
1242 /** \brief returns the "other" axis, refernced by otherAxisRef */
1244
1245 protected:
1246
1247 /** \brief references the other axis fromm the JKQTPBasePLotter to use as "other" axis */
1249
1250};
1251
1252/*! \brief implements a position-indipendent horizontal axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
1253 \ingroup jkqtpbaseplotter_elements
1254
1255 This axis may be draw at a user-supplied position (used e.g. for color bar axes).
1256 The axis positioning parameters are supplied via the constructor,or setter methods.
1257
1258 \image html JKQTPHorizontalIndependentAxisPositioning.png
1259
1260 Basically this class overwrites several virtual methods as follows:
1261 - getParentPlotWidth() returns axisWidth, provided in the connstructor or via setParentPlotWidth()
1262 - getParentPlotOffset() returns axisOffset, provided in the connstructor or via setParentPlotOffset()
1263 - getParentOtheraxisWidth() returns otherAxisWidth, provided in the connstructor or via setParentPlotOtheraxisWidth()
1264 - getParentOtheraxisOffset() returns otherAxisOffset, provided in the connstructor or via setParentPlotOtheraxisOffset()
1265 .
1266
1267 If it is paired with another axis, the parameters of that axis have to be given explizitly in the constructor or with setters.
1268
1269 */
1271 Q_OBJECT
1272 protected:
1273 public:
1274 /** \brief class constructor */
1275 JKQTPHorizontalIndependentAxis(double axisOffset, double axisWidth, double otherAxisOffset, double otherAxisWidth, JKQTBasePlotter* parent);
1276
1277 /** copydoc JKQTPCoordinateAxis::getParentPlotWidth() */
1278 virtual double getParentPlotWidth() const override;
1279 /** copydoc JKQTPCoordinateAxis::getParentPlotOffset() */
1280 virtual double getParentPlotOffset() const override;
1281 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisWidth() */
1282 virtual double getParentOtheraxisWidth() const override;
1283 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisInverted() */
1284 virtual bool getParentOtheraxisInverted() const override;
1285 /** copydoc JKQTPCoordinateAxis::getParentOtheraxisOffset() */
1286 virtual double getParentOtheraxisOffset() const override;
1287 /** copydoc JKQTPCoordinateAxis::parentOtherAxisX2P() */
1288 virtual double parentOtherAxisX2P(double x) const override;
1289 /** copydoc JKQTPCoordinateAxis::drawAxes() */
1290 virtual void drawAxes(JKQTPEnhancedPainter& painter, int move1=0, int move2=0) override;
1291 public Q_SLOTS:
1292 /** \brief set the axis offset */
1293 virtual void setAxisOffset(double __value);
1294 /** \brief set the axis width */
1295 virtual void setAxisWidth(double __value);
1296 /** \brief set the other axis offset */
1297 virtual void setOtherAxisOffset(double __value);
1298 /** \brief set the other axis width */
1299 virtual void setOtherAxisWidth(double __value);
1300 /** \brief set whether the other axis is inverted */
1301 virtual void setOtherAxisInverted(bool __value);
1302
1303 protected:
1304
1305
1306 /** \brief the offset of the axis */
1308 /** \brief the width of the axis */
1310 /** \brief the width of the other axis */
1312 /** \brief the offset of the other axis */
1314 /** \brief indicates whether the other axis is inverted */
1316};
1317
1318#endif // JKQTPCOORDINATEAXES_H
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
this virtual class is the base for any type of coordinate axis, to be drawn by JKQTBasePlotter.
Definition jkqtpcoordinateaxes.h:181
bool axisRangeFixed
indicates whether this axis is fixed, i.e. axismin and axismax are frozen to their current values
Definition jkqtpcoordinateaxes.h:785
virtual void saveSettings(QSettings &settings, const QString &group=QString("plots/axes/")) const
saves the plot properties into a QSettings object.
double getTickWidth() const
line width of ticks in pt
Definition jkqtpcoordinateaxes.h:389
JKQTPCoordinateAxis(JKQTBasePlotter *parent)
class constructor
int calcLinearUnitDigits()
Calculate the number of digits needed for the labels of an axis that starts at minval and where the t...
void setAbsoluteRange(double aamin, double aamax)
sets absolutely limiting range of the plot
void redrawPlot()
simply calls the redrawPlot method of the parent plotter class
void setTickLabelColor(QColor c)
color of axis tick labels
double getTickUnitFactor() const
tick values are the actual x/y-coordiniate, divided by this value (e.g. pu to have an axis with valu...
Definition jkqtpcoordinateaxes.h:312
double userLogTickSpacing
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
Definition jkqtpcoordinateaxes.h:847
bool getInverted() const
indicates whether the axis is to be inverted or not
Definition jkqtpcoordinateaxes.h:300
virtual double getParentPlotWidth() const =0
width of the plot in the direction of the axis
void setLabelColor(QColor c)
color of the axis label
void setTickLabelAngle(double __value)
rotation angle of tick labels [-180..180], i.e. given in degrees, default is 0 (horizontal)
double tickSpacingLog
calculated property: axis tick spacing for logarithmic JKQTPCoordinateAxisStyle::ticks (calculated by...
Definition jkqtpcoordinateaxes.h:858
void setMinTicks(unsigned int __value)
minimum number of axis ticks
void setLabelDigits(int __value)
digits used for tick labels
bool isLinearAxis() const
returns whether this axis uses linear scaling (is false e.g. for isLogAxis()==true)
double getMinorTickLabelFontSize() const
fontsize of the minor axis tick labels
Definition jkqtpcoordinateaxes.h:322
bool logAxis
indicates whether the y axis has a logarithmic scale
Definition jkqtpcoordinateaxes.h:837
const JKQTPCoordinateAxisStyle & getCurrentAxisStyle() const
current style properties for this JKQTBasePlotter
double getTickLabelFontSize() const
fontsize of the axis tick labels
Definition jkqtpcoordinateaxes.h:320
bool isLogAxis() const
returns whether this axis uses logarithmic scaling
void setMinorTicks(int __value)
number of minor grid lines per (major) axis tick interval
void addAxisTickLabels(const QVector< double > &x, const QStringList &label)
add a new tick label to the axis
void setTickUnit(double factor, const QString &name)
sets tickUnitFactor and tickUnitName in one call
JKQTPLabelPosition getLabelPosition() const
position of the axis label
Definition jkqtpcoordinateaxes.h:316
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0)=0
draw the axes
void setLineWidthZeroAxis(double __value)
line width of 0-line in pt
JKQTMathText * getParentMathText()
retun parents JKQTMathText* object
virtual void setParent(JKQTBasePlotter *parent)
void drawAxisLine(JKQTPEnhancedPainter &painter, const QLineF &l, JKQTPCADrawMode drawMode) const
draw the axis line l (pointing from axismin to axismax) optionally decorated as specified by drawMode...
double getLineWidthZeroAxis() const
line width of 0-line in pt
Definition jkqtpcoordinateaxes.h:393
JKQTBasePlotter * getParent()
parent plotter class
Definition jkqtpcoordinateaxes.h:415
void setAutoAxisSpacing(bool __value)
calculated property: indicates whether the object should use automatic tick spacing for the x axis (c...
bool getDrawGrid() const
indicates whether to draw the major grid lines
Definition jkqtpcoordinateaxes.h:399
double getMinorGridWidth() const
width of the grid lines (in pixel)
Definition jkqtpcoordinateaxes.h:360
double getMax() const
returns the current max
Definition jkqtpcoordinateaxes.h:432
virtual void drawGrids(JKQTPEnhancedPainter &painter)=0
draw grids
bool getDoUpdateScaling() const
can be used to switch off calcPlotScaling() temporarily, while modifying some properties
Definition jkqtpcoordinateaxes.h:422
double tickStart
calculated property: x position of the first tick (calculated by calcPlotScaling() )....
Definition jkqtpcoordinateaxes.h:828
QColor getMinorTickColor() const
color of minor ticks
Definition jkqtpcoordinateaxes.h:342
double getGridWidth() const
width of the grid lines (in pixel)
Definition jkqtpcoordinateaxes.h:356
double calcLogTickSpacing()
same as calcLinearTickSpacing(), but for logarithmic scaling
double getTickSpacing() const
calculated property: axis tick spacing (calculated by calcPlotScaling() and calcTickSpacing() ) for l...
Definition jkqtpcoordinateaxes.h:290
void setLogAxisBase(double __value)
the base for a logarithmic x axis
QString getTickDateFormat() const
format string for date tick labels, see QDateTime::toString() documentation for details on format str...
Definition jkqtpcoordinateaxes.h:366
void setMinorGridColor(const QColor &__value)
color of the grid
double getLineWidth() const
line width of axis in pt
Definition jkqtpcoordinateaxes.h:391
void setCurrentAxisStyle(const JKQTPCoordinateAxisStyle &style)
replace the current style properties for this JKQTBasePlotter
const JKQTBasePlotter * getParent() const
parent plotter class
Definition jkqtpcoordinateaxes.h:413
void setLineWidth(double __value)
line width of axis in pt
void setTickInsideLength(double __value)
length of an axis tick inside the plot border in pt
QString getTickDateTimeFormat() const
format string for datetime tick labels, see QDateTime::toString() documentation for details on format...
Definition jkqtpcoordinateaxes.h:368
void setAxisColor(const QColor &__value)
color of the axis (labels, ticks, axis itself ...)
double getUserTickSpacing() const
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
Definition jkqtpcoordinateaxes.h:304
QString floattolabel(double data) const
convert a float to a tick label string
void setMinorGridColor(const QColor &__value, double alpha)
color of the grid
void setLabelFontSize(double __value)
fontsize of the axis labels
double getTickOutsideLength() const
length of an axis tick outside the plot border in pt
Definition jkqtpcoordinateaxes.h:332
QColor getMinorGridColor() const
color of the grid
Definition jkqtpcoordinateaxes.h:354
unsigned int getMinTicks() const
minimum number of axis ticks
Definition jkqtpcoordinateaxes.h:328
virtual double getParentOtheraxisOffset() const =0
pixel offset of (perpendicular) other axis (needed for grids)
void setDrawMode2(JKQTPCADrawMode __value)
draw mode of the secondary (right/top) axis
double userTickSpacing
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
Definition jkqtpcoordinateaxes.h:843
JKQTPCoordinateAxisStyle axisStyle
current style properties for this coordinate axis instance
Definition jkqtpcoordinateaxes.h:797
void setMinorTickWidth(double __value)
line width of minor ticks in pt
double scaleSign
this is used by x2p() and p2x() to determine the sign
Definition jkqtpcoordinateaxes.h:913
void setAutoLabelDigits(bool __value)
when true, the digits of the labels are calculated automatically
Definition jkqtpcoordinateaxes.h:403
void setMinorTickInsideLength(double __value)
length of a minor axis tick inside the plot border in pt
void setMinorTickLabelsEnabled(bool __value)
if true, the plotter displays minor axis labels as number between 1 and 10 in some cases
JKQTPLabelTickMode getTickMode() const
mode of the major ticks
Definition jkqtpcoordinateaxes.h:372
double getMin() const
returns the current min
Definition jkqtpcoordinateaxes.h:429
QColor getGridColor() const
color of the grid
Definition jkqtpcoordinateaxes.h:352
virtual ~JKQTPCoordinateAxis()
class destructor
QColor getMinorTickLabelColor() const
color of minor tick labels
Definition jkqtpcoordinateaxes.h:344
void setGridColor(const QColor &__value, double alpha)
color of the grid
unsigned int getMinorTicks() const
number of minor grid lines per (major) axis tick interval
Definition jkqtpcoordinateaxes.h:330
QString getTickUnitName() const
name of the factor tickUnitFactor. This string is used in tick-labels to write e.g....
Definition jkqtpcoordinateaxes.h:314
virtual double parentOtherAxisX2P(double x) const =0
calls x2p() of the other axis (or returns NAN if the other axis does not exist
void setRangeFixed(bool fixed)
fixes/ufixes the axis
QString getAxisLabel() const
axis label of the axis
Definition jkqtpcoordinateaxes.h:310
void setTickOutsideLength(double __value)
length of an axis tick outside the plot border in pt
double getAbsoluteMax() const
returns the current absolute max
Definition jkqtpcoordinateaxes.h:441
void setShowZeroAxis(bool __value)
indicates whether to draw a thick axis line at x=0 (zero axis)
virtual AxisElementsSizeDescription getSize2(JKQTPEnhancedPainter &painter)=0
returns the size of the right/top axis in pixels
bool paramsChanged
indicates whether one of the parameters has changed sinse the last recalculation of tickSpacing ....
Definition jkqtpcoordinateaxes.h:754
double getAbsoluteMin() const
returns the current absolute min
Definition jkqtpcoordinateaxes.h:438
double offset
calculated property: axis offset (calculated by calcPlotScaling() )
Definition jkqtpcoordinateaxes.h:817
virtual void loadSettings(const QSettings &settings, const QString &group=QString("plots/axes/"))
loads the plot properties from a QSettings object
void setTickUnitFactor(double __value)
tick values are the actual x/y-coordiniate, divided by this value (e.g. pu to have an axis with valu...
void setTickWidth(double __value)
line width of ticks in pt
void setMinorGridWidth(double __value)
width of the grid lines (in pixel)
void setTickColor(QColor c)
color of axis ticks
bool getAutoAxisSpacing() const
calculated property: indicates whether the object should use automatic tick spacing for the x axis (c...
Definition jkqtpcoordinateaxes.h:294
double scale
calculated property: axis scaling factor (calculated by calcPlotScaling() )
Definition jkqtpcoordinateaxes.h:812
QVector< QPair< double, QString > > tickLabels
a list of tick labels.
Definition jkqtpcoordinateaxes.h:771
void setTickDateTimeFormat(const QString &__value)
format string for datetime tick labels, see QDateTime::toString() documentation for details on format...
QColor getTickLabelColor() const
color of axis tick labels
Definition jkqtpcoordinateaxes.h:348
virtual Axis0ElementsSizeDescription getSize0(JKQTPEnhancedPainter &painter)
returns the size of the zero axis in pixels, the first part of the return-value is the lhs size and t...
void setGridStyle(Qt::PenStyle __value)
line stye of the grid lines
void addAxisTickLabels(const double *x, const QString *label, int items)
add a new tick label to the axis
virtual double getParentPlotOffset() const =0
offset of the plot in the direction of the axis
double axisabsoultemax
absoulte maximum of axis (axismin/axismax xan not be set above this)
Definition jkqtpcoordinateaxes.h:790
double axisabsoultemin
absoulte minimum of axis (axismin/axismax xan not be set below this)
Definition jkqtpcoordinateaxes.h:788
QString axisPrefix
axis prefix for storage of parameters
Definition jkqtpcoordinateaxes.h:911
void setTickLabelFontSize(double __value)
fontsize of the axis tick labels
bool getAutoLabelDigits() const
when true, the digits of the labels are calculated automatically
Definition jkqtpcoordinateaxes.h:408
QString tickUnitName
name of the factor tickUnitFactor. This string is used in tick-labels to write e.g....
Definition jkqtpcoordinateaxes.h:868
void loadCurrentAxisStyle(const QSettings &settings, const QString &group="plot/axes/")
replace the current style properties for this JKQTBasePlotter with properties loaded from settings
void setDrawMode0(JKQTPCADrawMode __value)
draw mode of the zero axis
void addAxisTickLabel(double x, const QString &label)
add a new tick label to the axis
void addAxisTickLabels(const QVector< double > &x, const QString *label)
add a new tick label to the axis
void setDoUpdateScaling(bool __value)
can be used to switch off calcPlotScaling() temporarily, while modifying some properties
Definition jkqtpcoordinateaxes.h:417
void setGridColor(const QColor &__value)
color of the grid
void setUserTickSpacing(double __value)
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
JKQTPCADrawMode getDrawMode2() const
draw mode of the secondary (right/top) axis
Definition jkqtpcoordinateaxes.h:385
void setAxisLabel(const QString &__value)
axis label of the axis
QString getTickFormatfFormat() const
format string for std::format tick labels, (see e.g. https://en.cppreference.com/w/cpp/utility/format...
Definition jkqtpcoordinateaxes.h:376
bool getMinorTickLabelFullNumber() const
indicates whether the minor tick labels should be full numbers, or just a number between 0....
Definition jkqtpcoordinateaxes.h:324
void setArrowSizeFactor(double f)
factor used to calculate the size of line arrows
void setDrawMinorGrid(bool __value)
indicates whether to draw the major grid lines
void setTickLabelType(JKQTPCALabelType __value)
indicates how to draw the labels
QSizeF getMaxTickLabelSize(JKQTPEnhancedPainter &painter, double *ascent=nullptr, double *descent=nullptr)
calculates the maximum width and height (returned as QSize) of all tick labels. Ascent and descent ma...
void setMinorGridStyle(Qt::PenStyle __value)
line stye of the grid lines
void clearAxisTickLabels()
clear axis tick labels. This switches back to automatic labels mode for the axis.
void setTickMode(JKQTPLabelTickMode __value)
mode of the major ticks
double getTickLabelDistance() const
distance between tick end and label start in pt
Definition jkqtpcoordinateaxes.h:395
void setMinorTickOutsideLength(double __value)
length of a minor axis tick outside the plot border in pt
double getZeroAxisPos(bool *drawZeroAxis=nullptr)
calculate the position of the zero-axis (and whether to draw it or not)
void calcPlotScaling(bool force=false)
calculate the scaling and offset values from axis min/max values
void setMinorTickColor(QColor c)
color of minor ticks
virtual double getParentOtheraxisWidth() const =0
width of other (perpendicular) axis (needed for grids)
bool getShowZeroAxis() const
indicates whether to draw a thick axis line at x=0 (zero axis)
Definition jkqtpcoordinateaxes.h:350
double calcLinearTickSpacing()
calculates the tick spacing for a linear axis that spans awidth and that should show at least JKQTPCo...
bool autoAxisSpacing
calculated property: indicates whether the object should use automatic tick spacing for the x axis (c...
Definition jkqtpcoordinateaxes.h:834
bool getLogAxis() const
indicates whether the y axis has a logarithmic scale
Definition jkqtpcoordinateaxes.h:298
void setTickLabelDistance(double __value)
distance between tick end and label start in pt
void setMax(double amax)
set axis minimum range of plot axis
Qt::PenStyle getGridStyle() const
line stye of the grid lines
Definition jkqtpcoordinateaxes.h:358
double getLabelDistance() const
distance between tick label and axis label in pt
Definition jkqtpcoordinateaxes.h:397
QString axisLabel
axis label of the axis
Definition jkqtpcoordinateaxes.h:862
void setTickPrintfFormat(const QString &__value)
format string for printf tick labels, see https://en.wikipedia.org/wiki/Printf_format_string document...
virtual bool getParentOtheraxisInverted() const =0
is other (perpendicular) axis inverted (needed for grids)
void setTickMode(int __value)
mode of the major ticks
void setMinorTickLabelColor(QColor c)
color of minor tick labels
QColor getTickColor() const
color of axis ticks
Definition jkqtpcoordinateaxes.h:346
void setDrawMode1(JKQTPCADrawMode __value)
draw mode of the main (left/bottom) axis
bool doUpdateScaling
can be used to switch off calcPlotScaling() temporarily, while modifying some properties
Definition jkqtpcoordinateaxes.h:761
void setTickFormatFormat(const QString &__value)
format string for std::format tick labels, (see e.g. https://en.cppreference.com/w/cpp/utility/format...
void setTickDateFormat(const QString &__value)
format string for date tick labels, see QDateTime::toString() documentation for details on format str...
void setMinorTickLabelFullNumber(bool __value)
indicates whether the minor tick labels should be full numbers, or just a number between 0....
QColor getAxisColor() const
color of the axis (labels, ticks, axis itself ...)
Definition jkqtpcoordinateaxes.h:338
void setMinorTicks(unsigned int __value)
number of minor grid lines per (major) axis tick interval
bool inverted
indicates whether the axis is to be inverted or not
Definition jkqtpcoordinateaxes.h:822
double getUserLogTickSpacing() const
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
Definition jkqtpcoordinateaxes.h:306
void setLogAxis(bool __value)
indicates whether the y axis has a logarithmic scale
double width
calculated property: width of plot on axis (calculated by calcPlotScaling() )
Definition jkqtpcoordinateaxes.h:806
void setNoAbsoluteRange()
do not use an absolute range of plot axis
void setRange(double amin, double amax)
set range of plot axis
void saveCurrentAxisStyle(QSettings &settings, const QString &group="plot/axes/") const
store the current style properties for this JKQTBasePlotter with properties loaded from settings
double getLabelFontSize() const
fontsize of the axis labels
Definition jkqtpcoordinateaxes.h:318
JKQTPCADrawMode getDrawMode0() const
draw mode of the zero axis
Definition jkqtpcoordinateaxes.h:381
void setUserLogTickSpacing(double __value)
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
bool getNextLabel(double &x, QString &label, bool init=false)
calculates the next label from the given parameters.
double x2p(double x) const
return x-pixel coordinate from x coordinate
Definition jkqtpcoordinateaxes.h:202
void resetTickUnit()
resets tickUnitFactor and tickUnitName in one call
double p2x(double x) const
return x coordinate from x-pixel
Definition jkqtpcoordinateaxes.h:218
void setColor(QColor c)
sets all colors (line, ticks, label, ...) of the axis
double getNextLabelDistance(double x)
returns the distance from the current tick position (x before call) to the next tick position
double tickUnitFactor
tick values are the actual x/y-coordiniate, divided by this value (e.g. pu to have an axis with valu...
Definition jkqtpcoordinateaxes.h:865
double axismax
current view: maximum of axis
Definition jkqtpcoordinateaxes.h:783
virtual AxisElementsSizeDescription getSize1(JKQTPEnhancedPainter &painter)=0
returns the sizerequirement of the left/bottom axis in pixels
int getLabelDigits() const
digits used for tick labels
Definition jkqtpcoordinateaxes.h:292
void addAxisTickLabels(const double *x, const QStringList &label)
add a new tick label to the axis
double getMinorTickWidth() const
line width of minor ticks in pt
Definition jkqtpcoordinateaxes.h:387
double getArrowSizeFactor() const
factor used to calculate the size of line arrows
Definition jkqtpcoordinateaxes.h:334
void setMinorTickLabelFontSize(double __value)
fontsize of the minor axis tick labels
void setMin(double amin)
set axis minimum range of plot axis
double tickSpacing
calculated property: axis tick spacing (calculated by calcPlotScaling() and calcTickSpacing() ) for l...
Definition jkqtpcoordinateaxes.h:853
double axismin
current view: minimum of axis
Definition jkqtpcoordinateaxes.h:781
void setTickUnitPi()
sets pi-scaling for tickUnitFactor and tickUnitName in one call
void setLabelPosition(JKQTPLabelPosition __value)
position of the axis label
double axisMinWidth
absolute minimum range width, feature switched off when <0
Definition jkqtpcoordinateaxes.h:800
double getLogAxisBase() const
the base for a logarithmic x axis
Definition jkqtpcoordinateaxes.h:302
bool isAxisRangeFixed() const
returns whether the axis range is fixed, i.e. may not change!
Definition jkqtpcoordinateaxes.h:435
void setDrawGrid(bool __value)
indicates whether to draw the major grid lines
double getTickLabelAngle() const
rotation angle of tick labels [-180..180], i.e. given in degrees, default is 0 (horizontal)
Definition jkqtpcoordinateaxes.h:326
virtual bool isSecondaryAxis() const
figures out (possibly by probing the parent JKQTBasePlotter), whether this axis is a secondary axis
JKQTPCALabelType getTickLabelType() const
indicates how to draw the labels
Definition jkqtpcoordinateaxes.h:308
void setTickTimeFormat(const QString &__value)
format string for time tick labels, see QDateTime::toString() documentation for details on format str...
double getMinorTickOutsideLength() const
length of a minor axis tick outside the plot border in pt
Definition jkqtpcoordinateaxes.h:336
bool getDrawMinorGrid() const
indicates whether to draw the major grid lines
Definition jkqtpcoordinateaxes.h:401
QColor getLabelColor() const
color of the axis label
Definition jkqtpcoordinateaxes.h:340
void setGridWidth(double __value)
width of the grid lines (in pixel)
QString getTickTimeFormat() const
format string for time tick labels, see QDateTime::toString() documentation for details on format str...
Definition jkqtpcoordinateaxes.h:364
double logAxisBase
the base for a logarithmic x axis
Definition jkqtpcoordinateaxes.h:839
void setTickUnitName(const QString &__value)
name of the factor tickUnitFactor. This string is used in tick-labels to write e.g....
QString floattolabel(double data, int past_comma) const
convert a float to a tick label string with a given precision
void setInverted(bool __value)
indicates whether the axis is to be inverted or not
void setAxisMinWidth(double __value)
absolute minimum range width, feature switched off when <0
JKQTBasePlotter * parent
parent plotter class
Definition jkqtpcoordinateaxes.h:779
JKQTPCADrawMode getDrawMode1() const
draw mode of the main (left/bottom) axis
Definition jkqtpcoordinateaxes.h:383
Qt::PenStyle getMinorGridStyle() const
line stye of the grid lines
Definition jkqtpcoordinateaxes.h:362
const JKQTMathText * getParentMathText() const
retun parents JKQTMathText* object
QString getTickPrintfFormat() const
format string for printf tick labels, see https://en.wikipedia.org/wiki/Printf_format_string document...
Definition jkqtpcoordinateaxes.h:370
bool getMinorTickLabelsEnabled() const
if true, the plotter displays minor axis labels as number between 1 and 10 in some cases
Definition jkqtpcoordinateaxes.h:296
void setLabelDistance(double __value)
distance between tick label and axis label in pt
Support Class for JKQTPCoordinateAxis, which summarizes all properties that define the visual styling...
Definition jkqtpcoordinateaxesstyle.h:87
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
base class for horizontal axes, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoo...
Definition jkqtpcoordinateaxes.h:1154
virtual void drawGrids(JKQTPEnhancedPainter &painter) override
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0) override
QSizeF getQSize1(JKQTPEnhancedPainter &painter)
virtual AxisElementsSizeDescription getSize1(JKQTPEnhancedPainter &painter) override
returns the size of the bottom axis in pixels
void drawTickLabel2(JKQTPEnhancedPainter &painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, double ascentMax, double descentMax, bool isMinor=false)
draw a tick label on the upper axis 2 with text label (with optional rotation) at ( xx ,...
QSizeF getQSize2(JKQTPEnhancedPainter &painter)
virtual Axis0ElementsSizeDescription getSize0(JKQTPEnhancedPainter &painter) override
void drawAxisLabel2(JKQTPEnhancedPainter &painter, double left, double top, QSizeF labelMax, JKQTPCADrawMode drawMode)
draw the axis label using painter for axis 2 at x= left and y= top. labelMax is the maximum Size of a...
void drawTickLabel1(JKQTPEnhancedPainter &painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, double ascentMax, double descentMax, bool isMinor=false)
draw a tick label on the lower axis 1 with text label (with optional rotation) at ( xx ,...
void drawAxisLabel1(JKQTPEnhancedPainter &painter, double left, double bottom, QSizeF labelMax, JKQTPCADrawMode drawMode)
draw the axis label using painter for axis 1 at x= left and y= bottom. labelMax is the maximum Size o...
virtual AxisElementsSizeDescription getSize2(JKQTPEnhancedPainter &painter) override
returns the size of the top axis in pixels
JKQTPHorizontalAxisBase(JKQTBasePlotter *parent)
class constructor
implements a horizontal axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoord...
Definition jkqtpcoordinateaxes.h:1221
JKQTPCoordinateAxisRef otherAxisRef
references the other axis fromm the JKQTPBasePLotter to use as "other" axis
Definition jkqtpcoordinateaxes.h:1248
virtual double getParentOtheraxisWidth() const override
JKQTPCoordinateAxisRef getOtherAxisRef() const
references the other axis fromm the JKQTPBasePLotter to use as "other" axis
virtual bool getParentOtheraxisInverted() const override
virtual double getParentPlotOffset() const override
JKQTPHorizontalAxis(JKQTBasePlotter *parent, JKQTPCoordinateAxisRef otherAxisRef_=JKQTPPrimaryAxis)
class constructor
virtual double getParentOtheraxisOffset() const override
const JKQTPCoordinateAxis * getOtherAxis() const
returns the "other" axis, refernced by otherAxisRef
virtual double parentOtherAxisX2P(double x) const override
virtual double getParentPlotWidth() const override
implements a position-indipendent horizontal axis, based on JKQTPCoordinateAxis (for most of document...
Definition jkqtpcoordinateaxes.h:1270
virtual double getParentPlotWidth() const override
bool otherAxisInverted
indicates whether the other axis is inverted
Definition jkqtpcoordinateaxes.h:1315
double otherAxisWidth
the width of the other axis
Definition jkqtpcoordinateaxes.h:1311
virtual double getParentOtheraxisOffset() const override
virtual void setAxisWidth(double __value)
set the axis width
virtual void setOtherAxisWidth(double __value)
set the other axis width
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0) override
virtual void setOtherAxisInverted(bool __value)
set whether the other axis is inverted
virtual double parentOtherAxisX2P(double x) const override
virtual double getParentOtheraxisWidth() const override
double axisOffset
the offset of the axis
Definition jkqtpcoordinateaxes.h:1307
double otherAxisOffset
the offset of the other axis
Definition jkqtpcoordinateaxes.h:1313
virtual void setAxisOffset(double __value)
set the axis offset
virtual void setOtherAxisOffset(double __value)
set the other axis offset
virtual double getParentPlotOffset() const override
virtual bool getParentOtheraxisInverted() const override
double axisWidth
the width of the axis
Definition jkqtpcoordinateaxes.h:1309
JKQTPHorizontalIndependentAxis(double axisOffset, double axisWidth, double otherAxisOffset, double otherAxisWidth, JKQTBasePlotter *parent)
class constructor
base class for vertical axes, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoord...
Definition jkqtpcoordinateaxes.h:967
QSizeF getQSize1(JKQTPEnhancedPainter &painter)
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0) override
virtual AxisElementsSizeDescription getSize1(JKQTPEnhancedPainter &painter) override
returns the size of the left axis in pixels
virtual AxisElementsSizeDescription getSize2(JKQTPEnhancedPainter &painter) override
returns the size of the right axis in pixels
void drawAxisLabel2(JKQTPEnhancedPainter &painter, double right, double bottom, QSizeF labelMax, JKQTPCADrawMode drawMode)
draw the axis label using painter for axis 2 at x= right and y= bottom. labelMax is the maximum Size ...
void drawTickLabel1(JKQTPEnhancedPainter &painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, bool isMinor=false)
draw a tick label on the left axis 1 with text label (with optional rotation) at ( xx ,...
QSizeF getQSize2(JKQTPEnhancedPainter &painter)
void drawAxisLabel1(JKQTPEnhancedPainter &painter, double left, double bottom, QSizeF labelMax, JKQTPCADrawMode drawMode)
draw the axis label using painter for axis 1 at x= left and y= bottom. labelMax is the maximum Size o...
virtual void drawGrids(JKQTPEnhancedPainter &painter) override
void drawTickLabel2(JKQTPEnhancedPainter &painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, bool isMinor=false)
draw a tick label on the right axis 2 with text label (with optional rotation) at ( xx ,...
virtual Axis0ElementsSizeDescription getSize0(JKQTPEnhancedPainter &painter) override
JKQTPVerticalAxisBase(JKQTBasePlotter *parent)
class constructor
implements a vertical axis for use as primary, secondary, ... axis of a JKQTPBasePlotter,...
Definition jkqtpcoordinateaxes.h:1032
JKQTPVerticalAxis(JKQTBasePlotter *parent, JKQTPCoordinateAxisRef otherAxisRef=JKQTPPrimaryAxis)
class constructor
JKQTPCoordinateAxisRef getOtherAxisRef() const
references the other axis fromm the JKQTPBasePLotter to use as "other" axis
virtual double getParentPlotWidth() const override
const JKQTPCoordinateAxis * getOtherAxis() const
returns the "other" axis, refernced by otherAxisRef
virtual double getParentPlotOffset() const override
virtual double getParentOtheraxisOffset() const override
virtual double parentOtherAxisX2P(double x) const override
virtual double getParentOtheraxisWidth() const override
JKQTPCoordinateAxisRef otherAxisRef
references the other axis fromm the JKQTPBasePLotter to use as "other" axis
Definition jkqtpcoordinateaxes.h:1060
virtual bool getParentOtheraxisInverted() const override
implements a position-indipendent vertical axis, based on JKQTPCoordinateAxis (for most of documentat...
Definition jkqtpcoordinateaxes.h:1083
virtual double parentOtherAxisX2P(double x) const override
virtual double getParentPlotOffset() const override
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0) override
virtual void setOtherAxisInverted(bool __value)
set whether the other axis is inverted
double axisWidth
the width of the axis
Definition jkqtpcoordinateaxes.h:1122
virtual void setAxisOffset(double __value)
set the axis offset
virtual double getParentOtheraxisOffset() const override
virtual void setOtherAxisWidth(double __value)
set the other axis width
JKQTPVerticalIndependentAxis(double axisOffset, double axisWidth, double otherAxisOffset, double otherAxisWidth, JKQTBasePlotter *parent)
class constructor
double axisOffset
the offset of the axis
Definition jkqtpcoordinateaxes.h:1120
virtual void setAxisWidth(double __value)
set the axis width
virtual double getParentOtheraxisWidth() const override
virtual double getParentPlotWidth() const override
double otherAxisOffset
the offset of the other axis
Definition jkqtpcoordinateaxes.h:1126
bool otherAxisInverted
indicates whether the other axis is inverted
Definition jkqtpcoordinateaxes.h:1128
double otherAxisWidth
the width of the other axis
Definition jkqtpcoordinateaxes.h:1124
virtual void setOtherAxisOffset(double __value)
set the other axis offset
virtual bool getParentOtheraxisInverted() const override
QFlags< JKQTPCADrawModeElements > JKQTPCADrawMode
drawing mode for a coordinate axis
Definition jkqtptools.h:430
JKQTPCoordinateAxes
named references for different oordinate axes in the plot
Definition jkqtpcoordinateaxes.h:42
JKQTPLabelPosition
position of the axis labels
Definition jkqtptools.h:508
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
JKQTPCoordinateAxes JKQTPCoordinateAxisRef
type for indexing coordinate axes in a plot
Definition jkqtpcoordinateaxes.h:50
JKQTPCALabelType
display mode for the (axis) labels
Definition jkqtptools.h:449
JKQTPLabelTickMode
mode of the axis ticks
Definition jkqtptools.h:476
@ JKQTPPrimaryAxis
Definition jkqtpcoordinateaxes.h:43
@ JKQTPSecondaryAxis
Definition jkqtpcoordinateaxes.h:44
Definition jkqtpcoordinateaxes.h:742
Axis0ElementsSizeDescription(double _requiredSize=0.0, double _requiredSizeOpposite=0.0, double _elongateMin=0.0, double _elongateMax=0.0)
Definition jkqtpcoordinateaxes.h:743
double maxRequiredSize() const
Definition jkqtpcoordinateaxes.h:746
double requiredSizeOpposite
additional size, required for the axis, in the opposite direction as AxisElementsSizeDescription::req...
Definition jkqtpcoordinateaxes.h:745
return value type for getSize1() and getSize2()
Definition jkqtpcoordinateaxes.h:250
AxisElementsSizeDescription(double _requiredSize=0.0, double _elongateMin=0.0, double _elongateMax=0.0)
Definition jkqtpcoordinateaxes.h:251
double requiredSize
required space, starting at the axis line, in outward direction [pixels]
Definition jkqtpcoordinateaxes.h:254
double elongateMin
extra space on the min (horizontal: left, vertical: bottom) side BESIDE the axis, e....
Definition jkqtpcoordinateaxes.h:256
double elongateMax
extra space on the max (horizontal: right, vertical: top) side BESIDE the axis, e....
Definition jkqtpcoordinateaxes.h:258