本文整理汇总了C++中QwtPlotCurve::minYValue方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotCurve::minYValue方法的具体用法?C++ QwtPlotCurve::minYValue怎么用?C++ QwtPlotCurve::minYValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotCurve
的用法示例。
在下文中一共展示了QwtPlotCurve::minYValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: boundingRect
QwtDoubleRect Plot::boundingRect ()
{
QMapIterator<int, QwtPlotCurve *> it = d_curves.begin();
QwtPlotCurve *c = (QwtPlotCurve *)it.data();
double minX = c->minXValue();
double minY = c->minYValue();
double maxX = c->maxXValue();
double maxY = c->maxYValue();
it++;
for (it; it != d_curves.end(); ++it)
{
QwtPlotCurve *c = (QwtPlotCurve *)it.data();
if (!c)
continue;
minX = (c->minXValue() < minX) ? c->minXValue() : minX;
maxX = (c->maxXValue() > maxX) ? c->maxXValue() : maxX;
minY = (c->minYValue() < minY) ? c->minYValue() : minY;
maxY = (c->maxYValue() > maxY) ? c->maxYValue() : maxY;
}
QwtDoubleRect r;
r.setLeft(minX);
r.setRight(maxX);
r.setTop(minY);
r.setBottom(maxY);
return r;
}
示例2: scaleCurves
void LinePlot::scaleCurves(QwtPlotCurve *curve)
{
/// multiple curves based on units
const QwtPlotItemList &listPlotItem = m_qwtPlot->itemList();
QwtPlotCurve *plotCurve;
QwtPlotItemIterator itPlotItem;
int curveCount = numberOfCurves();
switch (curveCount)
{
case 0:
{
curve->setYAxis(QwtPlot::yLeft);
m_qwtPlot->enableAxis(QwtPlot::yRight, false);
break;
}
case 1:
{
curve->setYAxis(QwtPlot::yRight);
m_qwtPlot->enableAxis(QwtPlot::yRight, true);
break;
}
default: //scale
m_qwtPlot->enableAxis(QwtPlot::yRight, false);
// find min, max of all curves
// scale
int i;
for ( itPlotItem = listPlotItem.begin();itPlotItem!=listPlotItem.end();++itPlotItem)
{
if ( (*itPlotItem)->rtti() == QwtPlotItem::Rtti_PlotCurve)
{
plotCurve = (QwtPlotCurve*) (*itPlotItem);
if ((plotCurve->minYValue() != 0) || (plotCurve->maxYValue() != 1))
{
QwtArray<double> xData(plotCurve->dataSize());
QwtArray<double> yData(plotCurve->dataSize());
for (i = 0; i < plotCurve->dataSize(); i++)
{
xData[i] = plotCurve->x(i);
yData[i] = (plotCurve->y(i) - plotCurve->minYValue())/ (plotCurve->maxYValue() - plotCurve->minYValue());
}
// reset data
plotCurve->setTitle(plotCurve->title().text() + "[" + QString::number(plotCurve->minYValue()) + ", " + QString::number(plotCurve->maxYValue()) + "]");
plotCurve->setData(xData,yData);
}
}
}
break;
}
}
示例3: set_y_axis_logscale
void Data_analysis_gui::set_y_axis_logscale( bool on ) {
/*
if (plot_->axisScaleEngine(QwtPlot::xBottom)->transformation()->type() ==
QwtScaleTransformation::Log10 && on)
return;
if (plot_->axisScaleEngine(QwtPlot::xBottom)->transformation()->type() ==
QwtScaleTransformation::Linear && (!on))
return;
*/
if( on ) {
// Before allowing to go to log scaling, make sure all values are > 0:
// if some are < 0, return without doing anything
QwtPlotItemList L = plot_->itemList();
for (int i = 0; i < L.size(); ++i) {
if (L[i]->rtti() == QwtPlotItem::Rtti_PlotCurve) {
QwtPlotCurve * curve = dynamic_cast<QwtPlotCurve*>(L[i]);
if (curve->minYValue() <= 0)
return;
}
}
plot_->setAxisScaleEngine(QwtPlot::yLeft, new QwtLog10ScaleEngine);
}
else
plot_->setAxisScaleEngine(QwtPlot::yLeft, new QwtLinearScaleEngine);
plot_->replot();
}
示例4:
void PlotSettingsDialog::
setAutoScale( const std::vector<QwtPlot*>& plots, QwtPlot::Axis axis ) {
const double margin = 1.05;
for( unsigned int i=0 ; i < plots.size() ; i++ ) {
double max = -9e99;
double min = 9e99;
QwtPlotItemList L = plots[i]->itemList();
for (int id = 0; id < L.size(); ++id) {
if (L[id]->rtti() != QwtPlotItem::Rtti_PlotCurve)
continue;
QwtPlotCurve *curve = dynamic_cast<QwtPlotCurve*>(L[i]);
if( axis == QwtPlot::xBottom ) {
max = std::max( max, curve->maxXValue() );
min = std::min( min, curve->minXValue() );
}
else {
max = std::max( max, curve->maxYValue() );
min = std::min( min, curve->minYValue() );
}
}
plots[i]->setAxisScale( axis, min*(2-margin), max*margin );
plots[i]->replot();
}
}
示例5: activateCurve
void ExpDecayDialog::activateCurve(const QString& curveName)
{
QwtPlotCurve *c = graph->curve(curveName);
if (!c)
return;
ApplicationWindow *app = (ApplicationWindow *)this->parent();
if (!app)
return;
double start, end;
graph->range(curveName, &start, &end);
boxStart->setValue(QMIN(start, end));
boxYOffset->setValue(c->minYValue());
if (slopes < 2)
boxAmplitude->setValue(c->maxYValue() - c->minYValue());
}
示例6: activateCurve
void ExpDecayDialog::activateCurve(const QString &curveName) {
QwtPlotCurve *c = graph->curve(curveName);
if (!c)
return;
ApplicationWindow *app = dynamic_cast<ApplicationWindow *>(this->parent());
if (!app)
return;
int precision = app->fit_output_precision;
double start, end;
graph->range(graph->curveIndex(curveName), &start, &end);
boxStart->setText(QString::number(qMin(start, end)));
boxYOffset->setText(QString::number(c->minYValue(), 'g', precision));
if (slopes < 2)
boxAmplitude->setText(
QString::number(c->maxYValue() - c->minYValue(), 'g', precision));
}
示例7: updateAxes
//! Rebuild the scales and maps
void QwtPlot::updateAxes()
{
int i;
bool resetDone[axisCnt];
for (i = 0; i < axisCnt; i++)
resetDone[i] = FALSE;
//
// Adjust autoscalers
//
QIntDictIterator<QwtPlotCurve> itc(*d_curves);
for (QwtPlotCurve *c = itc.toFirst(); c != 0; c = ++itc )
{
if (c->dataSize() > 0) // don't scale curves with no data
{ // (minXValue() et al. would return 0.0)
int axis = c->xAxis();
if ( !resetDone[axis] )
{
d_as[axis].reset();
resetDone[axis] = TRUE;
}
d_as[axis].adjust(c->minXValue(), c->maxXValue());
axis = c->yAxis();
if ( !resetDone[axis] )
{
d_as[axis].reset();
resetDone[axis] = TRUE;
}
d_as[axis].adjust(c->minYValue(), c->maxYValue());
}
}
//
// Adjust scales
//
for (i=0; i<axisCnt; i++)
{
d_sdiv[i] = d_as[i].scaleDiv();
d_scale[i]->setScaleDiv(d_sdiv[i]);
}
d_grid.setXDiv(d_sdiv[d_grid.xAxis()]);
d_grid.setYDiv(d_sdiv[d_grid.yAxis()]);
}