// load the corresponding struct with optimization problem
//
optProbList = _mf->getOptProblems();
unsigned index= _mf->objFunction;
double (*f)(vector<double> coord) = optProbList[index]->benchmark;
double rangex1[2] = {optProbList[index]->min[_mf->dim_indices[0]], optProbList[index]->max[_mf->dim_indices[0]]};
double rangex2[2] = {optProbList[index]->min[_mf->dim_indices[1]], optProbList[index]->max[_mf->dim_indices[1]]};
Model *neuralNet = _mf->getMetaModel();
bool useMet = _mf->isMetaModelUsed();
// here the data for ploting is set from the function "SpectrogramData()", in which the data is generated
//
d_spectrogram->setData(SpectrogramData((*f), rangex1, rangex2, _mf->dim_indices , _mf->fixed_values, optProbList[index]->dimensions, value_interval, neuralNet, useMet));
d_spectrogram->attach(this); // attach the data to the plot widget
// set the colors for intensity values
//
colorMap.addColorStop(0.25, Qt::cyan);
colorMap.addColorStop(0.5, Qt::green);
colorMap.addColorStop(0.75, Qt::yellow);
d_spectrogram->setColorMap(colorMap);
// A color bar on the right axis
//
rightAxis->setTitle("Intensity");
rightAxis->setColorBarEnabled(true);
rightAxis->setColorMap(d_spectrogram->data().range(), d_spectrogram->colorMap()); //<<< here values range are required, but is not calculated yet
// set the scale of color bar
//
d_spectrogram->data().range().minValue(), //<<< here values range are required, but is not calculated yet
d_spectrogram->data().range().maxValue() ); //<<< here values range are required, but is not calculated yet
d_spectrogram = new QwtPlotSpectrogram();
// load the corresponding struct with optimization problem
//
optProbList = _mf->getOptProblems();
unsigned index= _mf->objFunction;
double (*f)(vector<double> coord) = optProbList[index]->benchmark;
double rangex1[2] = {optProbList[index]->min[_mf->dim_indices[0]], optProbList[index]->max[_mf->dim_indices[0]]};
double rangex2[2] = {optProbList[index]->min[_mf->dim_indices[1]], optProbList[index]->max[_mf->dim_indices[1]]};
QwtDoubleInterval value_interval = optProbList[index]->valuesRange;
Model *neuralNet = _mf->getMetaModel();
bool useMet = _mf->isMetaModelUsed();
// here the data for ploting is set from the function "SpectrogramData()", in which the data is generated
//
d_spectrogram->setData(SpectrogramData((*f), rangex1, rangex2, _mf->dim_indices , _mf->fixed_values, optProbList[index]->dimensions, value_interval, neuralNet, useMet));
d_spectrogram->attach(this); // attach the data to the plot widget
// set the colors for intensity values
//
QwtLinearColorMap colorMap(Qt::darkCyan, Qt::red);
colorMap.addColorStop(0.25, Qt::cyan);
colorMap.addColorStop(0.5, Qt::green);
colorMap.addColorStop(0.75, Qt::yellow);
d_spectrogram->setColorMap(colorMap);
// A color bar on the right axis
//
QwtScaleWidget *rightAxis = axisWidget(QwtPlot::yRight);
rightAxis->setTitle("Intensity");
rightAxis->setColorBarEnabled(true);
rightAxis->setColorMap(d_spectrogram->data().range(), d_spectrogram->colorMap()); //<<< here values range are required, but is not calculated yet
// set the scale of color bar
//
setAxisScale(QwtPlot::yRight,
d_spectrogram->data().range().minValue(), //<<< here values range are required, but is not calculated yet
d_spectrogram->data().range().maxValue() ); //<<< here values range are required, but is not calculated yet
enableAxis(QwtPlot::yRight);
To copy to clipboard, switch view to plain text mode
Bookmarks