28 result[
"Grayscale"] = QCPColorGradient::gpGrayscale;
29 result[
"Hot"] = QCPColorGradient::gpHot;
30 result[
"Cold"] = QCPColorGradient::gpCold;
31 result[
"Night"] = QCPColorGradient::gpNight;
32 result[
"Candy"] = QCPColorGradient::gpCandy;
33 result[
"Geography"] = QCPColorGradient::gpGeography;
34 result[
"Ion"] = QCPColorGradient::gpIon;
35 result[
"Thermal"] = QCPColorGradient::gpThermal;
36 result[
"Polar"] = QCPColorGradient::gpPolar;
37 result[
"Spectrum"] = QCPColorGradient::gpSpectrum;
38 result[
"Jet"] = QCPColorGradient::gpJet;
39 result[
"Hues"] = QCPColorGradient::gpHues;
46 QCPRange qcpRange(
double xmin,
double xmax,
int nbins)
48 double dx = (xmax - xmin) / nbins;
49 return QCPRange(xmin + dx / 2., xmax - dx / 2.);
52 QMargins defaultMargins(
const QWidget& widget)
55 int left =
static_cast<int>(base_size.width() * 6.0);
56 int top =
static_cast<int>(base_size.height() * 1.5);
57 int right =
static_cast<int>(base_size.width() * 1.2);
58 int bottom =
static_cast<int>(base_size.height() * 4.5);
59 return QMargins(left, top, right, bottom);
68 auto it = gradient_map.find(gradientName);
69 if (it == gradient_map.end())
70 throw Error(
"ColorMapHelper::getGradient() -> Error. No such gradient" + gradientName);
71 return QCPColorGradient(it.value());
101 QPair<double, double> range = item->
dataRange();
102 return QCPRange(range.first, range.second);
112 if (isLogz && scale->dataScaleType() != QCPAxis::stLogarithmic)
113 scale->setDataScaleType(QCPAxis::stLogarithmic);
115 else if (!isLogz && scale->dataScaleType() != QCPAxis::stLinear)
116 scale->setDataScaleType(QCPAxis::stLinear);
118 setLogz(scale->axis(), isLogz);
124 axis->setNumberFormat(
"eb");
125 axis->setNumberPrecision(0);
126 axis->setScaleType(QCPAxis::stLogarithmic);
127 QSharedPointer<QCPAxisTicker> ticker(
new QCPAxisTickerLog);
128 axis->setTicker(ticker);
130 axis->setNumberFormat(
"f");
131 axis->setNumberPrecision(0);
132 axis->setScaleType(QCPAxis::stLinear);
133 QSharedPointer<QCPAxisTicker> ticker(
new QCPAxisTicker);
134 axis->setTicker(ticker);
140 auto* axisRectangle = customPlot->axisRect();
141 axisRectangle->setAutoMargins(QCP::msTop | QCP::msBottom);
142 axisRectangle->setMargins(defaultMargins(*customPlot));
Defines class IntensityDataItem.
QMap< QString, QCPColorGradient::GradientPreset > gradient_map_t
Defines RangeUtils namespace.
Defines GUI::StyleUtils namespace.
double getLowerZ() const
Returns lower and upper zoom ranges of z-axis.
QPair< double, double > dataRange() const
Init zmin, zmax to match the intensity values range.
double xMin() const
Returns min and max range of x-axis as given by IntensityData.
double getLowerY() const
Returns lower and upper zoom ranges of y-axis.
QString getGradientValue() const
double getLowerX() const
Returns lower and upper zoom ranges of x-axis.
double yMin() const
Returns min and max range of y-axis as given by IntensityData.
QSize SizeOfLetterM(const QWidget *widget=nullptr)
Returns size of largest letter of default system font.
QCPRange itemYrange(const IntensityDataItem *item)
Returns y-axis range.
QCPColorGradient itemGradient(const IntensityDataItem *item)
QCPRange itemZoomY(const IntensityDataItem *item)
Returns y-axis vizible range (zoom).
void setLogz(QCPColorScale *scale, bool isLogz)
QCPColorGradient getGradient(const QString &gradientName)
void setDefaultMargins(QCustomPlot *customPlot)
Sets default margins for axes rectangle plot.
QCPRange itemXrange(const IntensityDataItem *item)
Returns x-axis range.
QCPRange itemDataRange(const IntensityDataItem *item)
Returns z-axis data range.
QCPRange itemDataZoom(const IntensityDataItem *item)
Returns z-axis visible range (zoom).
QCPRange itemZoomX(const IntensityDataItem *item)
Returns x-axis vizible range (zoom).