当前位置: 首页>>代码示例>>C++>>正文


C++ QwtPlotCurve::setYAxis方法代码示例

本文整理汇总了C++中QwtPlotCurve::setYAxis方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotCurve::setYAxis方法的具体用法?C++ QwtPlotCurve::setYAxis怎么用?C++ QwtPlotCurve::setYAxis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QwtPlotCurve的用法示例。


在下文中一共展示了QwtPlotCurve::setYAxis方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QwtPlotCurve

QwtPlotCurve * PlotViewWidget::addCurveData(WaveformData *curveData, bool secondary, QColor col)
{
    maWaveformData << curveData;

    QwtPlotCurve *waveCurve = new QwtPlotCurve("dummy");
    waveCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
    waveCurve->setPen(QPen(col));
    waveCurve->setSamples( curveData );
    maCurves << waveCurve;
    waveCurve->attach(this);

    if( !mSecondaryAxis || maCurves.length() == 0 ) // no secondary axis or just one plot
    {
        replot();
        setAxisScaleDiv(QwtPlot::yRight, axisScaleDiv(QwtPlot::yLeft));
        replot();
    }
    else
    {
        if(secondary)
        {
            setAxisAutoScale(QwtPlot::yRight);
            waveCurve->setYAxis(QwtPlot::yRight);
        }
        else
        {
            waveCurve->setYAxis(QwtPlot::yLeft);
        }
    }

    repaint();
    return waveCurve;
}
开发者ID:adamb924,项目名称:AcousticWorkspace,代码行数:33,代码来源:plotviewwidget.cpp

示例2: addCurves

void HarmPlot::addCurves() throw (QLE)
{
    Harmonics* harmonics = new Harmonics(this->dir, this->ii);
    for(int i=0; i <= MAX_HARM - 2; i++) {
        this->data[i] = harmonics->getHarm(i+2); // begin from second harmonic
        if( ! this->data[i])
            continue; // have not more harmonic in IR

        QString name = "Harmonic";
        name += i;
        QwtPlotCurve* curve = new QwtPlotCurve(name);
        curve->setPen(QPen(HARM_COLORS[i]));
        curve->setYAxis(QwtPlot::yLeft);
        curve->attach(this);
        curve->setSamples(this->data[i]->freqs, this->data[i]->values, this->data[i]->length);
    }
    delete harmonics;
}
开发者ID:mincequi,项目名称:QLouder,代码行数:18,代码来源:HarmPlot.cpp

示例3: throw

IRPlot::IRPlot(const QString& aDir, IRInfo anIi, QWidget *parent) throw (QLE) : QwtPlot(parent)
{
    this->dir = aDir;
    this->ii = anIi;

    this->time = 0;
    this->amps = 0;

    this->setAutoReplot(false);
    this->setCanvasBackground(BG_COLOR);

    unsigned curveLength = this->calculate();

    this->setAxisScale( xBottom, this->time[0], this->time[curveLength-1]);
    this->setAxisAutoScale( xBottom);
    this->setAxisScale( yLeft, -1.5, 1.5);

    QwtPlotGrid *grid = new QwtPlotGrid;
    grid->enableXMin(true);
#if QWT_VERSION > 0x060000
    grid->setMajorPen(QPen(MAJ_PEN_COLOR, 0, Qt::DotLine));
    grid->setMinorPen(QPen(MIN_PEN_COLOR, 0 , Qt::DotLine));
#else
    grid->setMajPen(QPen(MAJ_PEN_COLOR, 0, Qt::DotLine));
    grid->setMinPen(QPen(MIN_PEN_COLOR, 0 , Qt::DotLine));
#endif
    grid->attach(this);

    QwtPlotCurve* ampCurve = new QwtPlotCurve("IR_Plot");
    ampCurve->setPen(QPen(AMP_CURVE_COLOR));
    ampCurve->setYAxis(QwtPlot::yLeft);
    ampCurve->attach(this);
    ampCurve->setSamples(this->time, this->amps, curveLength);

    QwtPlotPanner* panner = new QwtPlotPanner(this->canvas());
    panner->setMouseButton(Qt::MidButton);
    panner->setEnabled(true);

    this->setAutoReplot(true);
}
开发者ID:mincequi,项目名称:QLouder,代码行数:40,代码来源:IRPlot.cpp

示例4: linePlotData

void LinePlot::linePlotData(LinePlotData::Ptr data,  const std::string& name, QColor color, double offset )
{
  if (!data) return;


  // set based on data - record overall min and max
  if ( (data->minX() < m_xAxisMin) || (data->maxX() > m_xAxisMax) )
  {
    if  (data->minX() < m_xAxisMin) m_xAxisMin = data->minX();
    if  (data->maxX() > m_xAxisMax) m_xAxisMax = data->maxX();
  }
  if (numberOfCurves() == 0)
  {
    m_lineThickness = 10;
  }


  /// todo - curve collection - shared pointers
  QwtPlotCurve * curve = new QwtPlotCurve(toQString(name));
  if (color == Qt::color0) 
  { // generate new color from color map
    color = curveColor(m_lastColor);
    m_lastColor = color;
  }
  curve->setPen(curvePen(color));
  curve->attach(m_qwtPlot);
  curve->setData(*data);

  // check for number of different units (std::string  based)
  QString curveUnits = toQString(data->units());
  if (m_leftAxisUnits == "NONE SPECIFIED")
  {
    m_leftAxisUnits = curveUnits;
    this->leftAxisTitleFromUnits(toString(m_leftAxisUnits));
    curve->setYAxis(QwtPlot::yLeft);
    m_qwtPlot->enableAxis(QwtPlot::yRight, false);
  }
  else if (m_leftAxisUnits.toUpper() == curveUnits.toUpper())
  {
    curve->setYAxis(QwtPlot::yLeft);
    m_qwtPlot->enableAxis(QwtPlot::yRight, false);
  }
  else if (m_rightAxisUnits == "NONE SPECIFIED")
  {
    m_rightAxisUnits = curveUnits;
    this->rightAxisTitleFromUnits(toString(m_rightAxisUnits));
    curve->setYAxis(QwtPlot::yRight);
    m_qwtPlot->enableAxis(QwtPlot::yRight, true);
  }
  else if (m_rightAxisUnits.toUpper() == curveUnits.toUpper())
  {
    curve->setYAxis(QwtPlot::yRight);
    m_qwtPlot->enableAxis(QwtPlot::yRight, true);
  }
  else // more than 2 units - scale all curves
  {
    scaleCurves(curve);
    m_qwtPlot->enableAxis(QwtPlot::yRight, false);
    this->leftAxisTitle("Scaled");
  }



/// update legend and replot
  showCurve(curve, true);

//  initZoomer();

}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:69,代码来源:LinePlot.cpp


注:本文中的QwtPlotCurve::setYAxis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。