|
virtual double | getTickStep (const QCPRange &range) Q_DECL_OVERRIDE |
|
virtual int | getSubTickCount (double tickStep) Q_DECL_OVERRIDE |
|
virtual QVector< double > | createTickVector (double tickStep, const QCPRange &range) Q_DECL_OVERRIDE |
|
virtual QString | getTickLabel (double tick, const QLocale &locale, QChar formatChar, int precision) |
|
virtual QVector< double > | createSubTickVector (int subTickCount, const QVector< double > &ticks) |
|
virtual QVector< QString > | createLabelVector (const QVector< double > &ticks, const QLocale &locale, QChar formatChar, int precision) |
|
void | trimTicks (const QCPRange &range, QVector< double > &ticks, bool keepOneOutlier) const |
|
double | pickClosest (double target, const QVector< double > &candidates) const |
|
double | getMantissa (double input, double *magnitude=0) const |
|
double | cleanMantissa (double input) const |
|
Specialized axis ticker suited for logarithmic axes.
This QCPAxisTicker subclass generates ticks with unequal tick intervals suited for logarithmic axis scales. The ticks are placed at powers of the specified log base (setLogBase).
Especially in the case of a log base equal to 10 (the default), it might be desirable to have tick labels in the form of powers of ten without mantissa display. To achieve this, set the number precision (QCPAxis::setNumberPrecision) to zero and the number format (QCPAxis::setNumberFormat) to scientific (exponential) display with beautifully typeset decimal powers, so a format string of "eb"
. This will result in the following axis tick labels:
The ticker can be created and assigned to an axis like this:
void QCPAxisTickerLog::setSubTickCount |
( |
int |
subTicks | ) |
|
Sets the number of sub ticks in a tick interval. Within each interval, the sub ticks are spaced linearly to provide a better visual guide, so the sub tick density increases toward the higher tick.
Note that subTicks is the number of sub ticks (not sub intervals) in one tick interval. So in the case of logarithm base 10 an intuitive sub tick spacing would be achieved with eight sub ticks (the default). This means e.g. between the ticks 10 and 100 there will be eight ticks, namely at 20, 30, 40, 50, 60, 70, 80 and 90.