本文整理汇总了C++中setAxisTitle函数的典型用法代码示例。如果您正苦于以下问题:C++ setAxisTitle函数的具体用法?C++ setAxisTitle怎么用?C++ setAxisTitle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAxisTitle函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QwtPlot
Plotter::Plotter( QWidget *parent ):
QwtPlot( parent )
{
// Assign a title
setTitle( "WAVE DATA" );
QwtPlotCanvas *canvas = new QwtPlotCanvas();
canvas->setFrameStyle( QFrame::Box | QFrame::Plain );
canvas->setLineWidth( 1 );
canvas->setPalette( Qt::white );
setCanvas( canvas );
alignScales();
// Insert grid
d_grid = new QwtPlotGrid();
d_grid->attach( this );
// Axis
setAxisTitle( QwtPlot::xBottom, "Time" );
// setAxisScale( QwtPlot::xBottom, -d_interval, 0.0 );
setAxisTitle( QwtPlot::yLeft, "Amplitude" );
// setAxisScale( QwtPlot::yLeft, -1.0, 1.0 );
resize(600, 350);
}
开发者ID:SibghatullahSheikh,项目名称:speech-recognition-tools,代码行数:28,代码来源:plotter.cpp
示例2: QwtPlot
Plot::Plot(QWidget *parent):
QwtPlot( parent )
{
// panning with the left mouse button
(void) new QwtPlotPanner( canvas() );
// zoom in/out with the wheel
(void) new QwtPlotMagnifier( canvas() );
setAutoFillBackground( true );
setPalette( QPalette( QColor( 165, 193, 228 ) ) );
updateGradient();
setTitle("A Simple QwtPlot Demonstration");
insertLegend(new QwtLegend(), QwtPlot::RightLegend);
// axes
setAxisTitle(xBottom, "x -->" );
setAxisScale(xBottom, 0.0, 10.0);
setAxisTitle(yLeft, "y -->");
setAxisScale(yLeft, -1.0, 1.0);
// canvas
canvas()->setLineWidth( 1 );
canvas()->setFrameStyle( QFrame::Box | QFrame::Plain );
canvas()->setBorderRadius( 15 );
QPalette canvasPalette( Qt::white );
canvasPalette.setColor( QPalette::Foreground, QColor( 133, 190, 232 ) );
canvas()->setPalette( canvasPalette );
populate();
}
开发者ID:albore,项目名称:pandora,代码行数:34,代码来源:sinusplot.cpp
示例3: setTitle
void HistPlot::populate()
{
setTitle("Watching TV during a weekend");
setAxisTitle(QwtPlot::yLeft, "Number of People");
setAxisTitle(QwtPlot::xBottom, "Number of Hours");
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableX(false);
grid->enableY(true);
grid->enableXMin(false);
grid->enableYMin(false);
grid->setMajPen(QPen(Qt::black, 0, Qt::SolidLine));
grid->attach(this);
const double juneValues[] = { 7, 19, 24, 32, 10, 5, 3 };
const double novemberValues[] = { 4, 15, 22, 34, 13, 8, 4 };
Histogram *histogramJune = new Histogram("Summer", Qt::red);
histogramJune->setValues(
sizeof(juneValues) / sizeof(double), juneValues);
histogramJune->attach(this);
Histogram *histogramNovember = new Histogram("Winter", Qt::blue);
histogramNovember->setValues(
sizeof(novemberValues) / sizeof(double), novemberValues);
histogramNovember->attach(this);
}
开发者ID:Quenii,项目名称:adcevm,代码行数:27,代码来源:histplot.cpp
示例4: STScurve
PerfPlot::PerfPlot() : STScurve(NULL), LTScurve(NULL), SBcurve(NULL), DAYcurve(NULL)
{
xsd = new PPTimeScaleDraw(QDateTime());
xsd->setTickLength(QwtScaleDiv::MajorTick, 3);
setAxisScaleDraw(QwtPlot::xBottom, xsd);
insertLegend(new QwtLegend(), QwtPlot::BottomLegend);
setAxisTitle(yLeft, tr("Exponentially Weighted Average Stress"));
setAxisTitle(xBottom, tr("Time (days)"));
setAxisTitle(yRight, tr("Daily Stress"));
enableAxis(yRight, true);
static_cast<QwtPlotCanvas*>(canvas())->setFrameStyle(QFrame::NoFrame);
setAxisMaxMinor(xBottom, 0);
setAxisMaxMinor(yLeft, 0);
setAxisMaxMinor(yRight, 0);
QwtScaleDraw *sd = new QwtScaleDraw;
sd->setTickLength(QwtScaleDiv::MajorTick, 3);
setAxisScaleDraw(QwtPlot::yLeft, sd);
sd = new QwtScaleDraw;
sd->setTickLength(QwtScaleDiv::MajorTick, 3);
setAxisScaleDraw(QwtPlot::yRight, sd);
grid = new QwtPlotGrid();
grid->attach(this);
configUpdate();
}
开发者ID:27sparks,项目名称:GoldenCheetah,代码行数:30,代码来源:PerfPlot.cpp
示例5: qSwap
void BarChart::setOrientation( int o )
{
const Qt::Orientation orientation =
( o == 0 ) ? Qt::Vertical : Qt::Horizontal;
int axis1 = QwtPlot::xBottom;
int axis2 = QwtPlot::yLeft;
if ( orientation == Qt::Horizontal )
qSwap( axis1, axis2 );
d_barChartItem->setOrientation( orientation );
setAxisTitle( axis1, "Distros" );
setAxisMaxMinor( axis1, 3 );
setAxisScaleDraw( axis1, new DistroScaleDraw( orientation, d_distros ) );
setAxisTitle( axis2, "Hits per day ( HPD )" );
setAxisMaxMinor( axis2, 3 );
QwtScaleDraw *scaleDraw = new QwtScaleDraw();
scaleDraw->setTickLength( QwtScaleDiv::MediumTick, 4 );
setAxisScaleDraw( axis2, scaleDraw );
plotLayout()->setCanvasMargin( 0 );
replot();
}
开发者ID:Au-Zone,项目名称:qwt,代码行数:27,代码来源:barchart.cpp
示例6: QwtPlot
EcgCh::EcgCh(QWidget *parent) :
QwtPlot(parent)
{
setMinimumHeight(10);
setMinimumWidth(10);
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableXMin(true);
grid->setMajPen(QPen(Qt::white, 0, Qt::DotLine));
grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
grid->attach(this);
setAxisTitle(QwtPlot::xBottom, "Czas [s]");
setAxisTitle(QwtPlot::yLeft, "Amplituda [mv]");
// picker = new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn, canvas());
// picker->setStateMachine(new QwtPickerDragPointMachine());
// picker->setRubberBandPen(QColor(Qt::green));
// picker->setRubberBand(QwtPicker::CrossRubberBand);
// picker->setTrackerPen(QColor(Qt::white));
curve = new QwtPlotCurve("signal");
curve->setYAxis(QwtPlot::yLeft);
curve->attach(this);
peaksCurve = new QwtPlotCurve("signal");
peaksCurve->setYAxis(QwtPlot::yLeft);
peaksCurve->setStyle(QwtPlotCurve::CurveStyle::Dots);
peaksCurve->setPen(QPen(Qt::red, 5));
peaksCurve->attach(this);
samples = new QVector<QPointF>;
data = new QwtPointSeriesData;
peaksSamples = new QVector<QPointF>;
peaksData = new QwtPointSeriesData;
replot();
}
开发者ID:mateuszkrasucki,项目名称:ECGAnalyzer-HRTDrawTest,代码行数:31,代码来源:ecgch.cpp
示例7: changeitems
void matrixofpixels::HistogramPlotProperty(double Xmin, double Xmax, double Ymax)
{
changeitems();
setAxisAutoScale(this->xTop);
setAxisAutoScale(this->xBottom);
//setAxisFont(QwtPlot::xBottom,QFont("Helvetica",15,1));
QwtText xlabel("Value");
QwtText ylabel("Events");
QColor col(Qt::red);
xlabel.setColor(col);
ylabel.setColor(col);
xlabel.setFont(QFont("Helvetica",15,1));
ylabel.setFont(QFont("Helvetica",15,1));
setAxisTitle(QwtPlot::xBottom,xlabel);
setAxisTitle(QwtPlot::yLeft,ylabel);
setCanvasBackground(QColor(Qt::white));
setAxisScale(QwtPlot::xBottom, Xmin, Xmax);
setAxisMaxMinor(QwtPlot::xBottom, 0);
setAxisScale(QwtPlot::yLeft, 0, Ymax);
setAxisMaxMinor(QwtPlot::yLeft, 0);
plotLayout()->setAlignCanvasToScales(true);
his->attach(this);
/*QwtPlotGrid **/grid = new QwtPlotGrid;
grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine));
grid->attach(this);
replot();
}
开发者ID:elkinvg,项目名称:prmpixread,代码行数:31,代码来源:matrixofpixels.cpp
示例8: QwtPlot
Plot::Plot( QWidget *parent ):
QwtPlot( parent ),
d_interval( 10.0 ), // seconds
d_timerId( -1 )
{
// Assign a title
setTitle( "Testing Refresh Rates" );
setCanvasBackground( Qt::white );
alignScales();
// Insert grid
d_grid = new QwtPlotGrid();
d_grid->attach( this );
// Insert curve
d_curve = new QwtPlotCurve( "Data Moving Right" );
d_curve->setPen( QPen( Qt::black ) );
d_curve->setData( new CircularBuffer( d_interval, 10 ) );
d_curve->attach( this );
// Axis
setAxisTitle( QwtPlot::xBottom, "Seconds" );
setAxisScale( QwtPlot::xBottom, -d_interval, 0.0 );
setAxisTitle( QwtPlot::yLeft, "Values" );
setAxisScale( QwtPlot::yLeft, -1.0, 1.0 );
d_clock.start();
setSettings( d_settings );
}
开发者ID:Spinetta,项目名称:qwt,代码行数:33,代码来源:plot.cpp
示例9: QwtPlot
//-----------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------
Plot::Plot(QString aname, QString acasename, QWidget *parent)
: QwtPlot(parent)
{
name = aname;
for (int i=0; i<ncmax; i++) {
curve[i] = 0;
}
ncurves = 0;
yscale = 0;
if (acasename.compare("conc")==0) {
setAxisTitle(QwtPlot::xBottom, "Distance (um)");
} else if (acasename.compare("vol")==0) {
setAxisTitle(QwtPlot::xBottom, "Volume fraction");
} else if (acasename.compare("oxy")==0) {
setAxisTitle(QwtPlot::xBottom, "O2 level");
} else {
setAxisTitle(QwtPlot::xBottom, "Time (hours)");
}
if (name.compare("") != 0) {
curve[0] = new QwtPlotCurve(acasename);
curve[0]->attach(this);
ncurves = 1;
replot();
}
}
开发者ID:gibbogle,项目名称:vspheroid-abm,代码行数:27,代码来源:plot.cpp
示例10: QwtPlot
BarChart::BarChart( QWidget *parent ):
QwtPlot( parent )
{
setAutoFillBackground( true );
setPalette( Qt::white );
canvas()->setPalette( QColor( "LemonChiffon" ) );
setTitle( "Bar Chart" );
setAxisTitle( QwtPlot::yLeft, "Whatever" );
setAxisTitle( QwtPlot::xBottom, "Whatever" );
d_barChartItem = new QwtPlotMultiBarChart( "Bar Chart " );
d_barChartItem->setLayoutPolicy( QwtPlotMultiBarChart::AutoAdjustSamples );
d_barChartItem->setSpacing( 20 );
d_barChartItem->setMargin( 3 );
d_barChartItem->attach( this );
insertLegend( new QwtLegend() );
populate();
setOrientation( 0 );
setAutoReplot( true );
}
开发者ID:svn2github,项目名称:Qwt_trunk,代码行数:27,代码来源:barchart.cpp
示例11: QwtPlot
Plot::Plot( QWidget *parent ):
QwtPlot( parent )
{
setPalette( QColor( 60, 60, 60 ) );
canvas()->setPalette( Qt::white );
// panning with the left mouse button
( void ) new QwtPlotPanner( canvas() );
// zoom in/out with the wheel
( void ) new QwtPlotMagnifier( canvas() );
setTitle( "Shapes" );
insertLegend( new QwtLegend(), QwtPlot::RightLegend );
// axes
setAxisTitle( QwtAxis::xBottom, "x -->" );
setAxisTitle( QwtAxis::yLeft, "y -->" );
#if 0
setAxisScaleEngine( QwtAxis::xBottom, new QwtLog10ScaleEngine );
setAxisScaleEngine( QwtAxis::yLeft, new QwtLog10ScaleEngine );
#endif
populate();
}
开发者ID:27sparks,项目名称:GoldenCheetah,代码行数:25,代码来源:shapes.cpp
示例12: QwtPlot
Plot::Plot( QWidget *parent ):
QwtPlot( parent ),
d_curve( NULL )
{
/*canvas()->setStyleSheet(
"border: 2px solid Black;"
"border-radius: 15px;"
"background-color: qlineargradient( x1: 0, y1: 0, x2: 0, y2: 1,"
"stop: 0 LemonChiffon, stop: 1 PaleGoldenrod );"
);*/
//QwtPlotCanvas *newcanvas=new QwtPlotCanvas();
//newcanvas->setPalette(Qt::white);
//newcanvas->setBorderRadius(10);
//setCanvas( newcanvas );
//plotLayout()->setAlignCanvasToScales( true );
setAxisTitle( QwtPlot::yLeft, "ylabel" );
setAxisTitle( QwtPlot::xBottom, "xlabel" );
//setAxisScale(QwtPlot::yLeft,0.0,25.0);
//setAxisScale(QwtPlot::xBottom,0.0,25.0);
//canvas()->resize(800, 600);
//plotLayout(AlignScales);
// attach curve
d_curve = new QwtPlotCurve( "Scattered Points" );
d_curve->setPen( QColor( "Black" ) );
// d_curve->setCurveAttribute(fitten);
// when using QwtPlotCurve::ImageBuffer simple dots can be
// rendered in parallel on multicore systems.
d_curve->setRenderThreadCount( 0 ); // 0: use QThread::idealThreadCount()
//d_curve->setCurveAttribute(QwtPlotCurve::Fitted, true);
d_curve->attach( this );
QwtSymbol * symbol2 = new QwtSymbol( QwtSymbol::XCross, QBrush(Qt::white), QPen(Qt::red, 1), QSize(6,6));
//QwtSymbol::Style style = Cross;
setSymbol( symbol2 );
//setSymbol(NULL);
// panning with the left mouse button
(void )new QwtPlotPanner( canvas() );
// zoom in/out with the wheel
QwtPlotMagnifier *magnifier = new QwtPlotMagnifier( canvas() );
magnifier->setMouseButton( Qt::NoButton );
// distanve measurement with the right mouse button
DistancePicker *picker = new DistancePicker( canvas() );
picker->setMousePattern( QwtPlotPicker::MouseSelect1, Qt::RightButton );
picker->setRubberBandPen( QPen( Qt::blue ) );
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableX( true );//设置网格线
grid->enableY( true );
grid->setMajorPen( Qt::black, 0, Qt::DotLine );
grid->attach( this );
//QSize sizeH = sizeHint();
}
开发者ID:Q55,项目名称:qtwinriver,代码行数:59,代码来源:plot.cpp
示例13: QwtPlot
StPlot::StPlot(QWidget* parent):
QwtPlot(parent),
viewFactor(-1.0)
{
setMinimumHeight(10);
setMinimumWidth(10);
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableXMin(true);
grid->setMajPen(QPen(Qt::white, 0, Qt::DotLine));
grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
grid->attach(this);
setAxisTitle(QwtPlot::xBottom, "Czas [s]");
setAxisTitle(QwtPlot::yLeft, "Amplituda [mv]");
curve = new QwtPlotCurve("Filtered signal");
curve->setYAxis(QwtPlot::yLeft);
curve->attach(this);
ISOPoints = new QwtPlotCurve("ISO");
ISOPoints->setStyle(QwtPlotCurve::NoCurve);
ISOPoints->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,QColor(Qt::green), QColor(Qt::green), QSize(5, 5)));
ISOPoints->setYAxis(QwtPlot::yLeft);
ISOPoints->attach(this);
JPoints = new QwtPlotCurve("J");
JPoints->setStyle(QwtPlotCurve::NoCurve);
JPoints->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,QColor(Qt::blue), QColor(Qt::blue), QSize(5, 5)));
JPoints->setYAxis(QwtPlot::yLeft);
JPoints->attach(this);
STPoints = new QwtPlotCurve("ST");
STPoints->setStyle(QwtPlotCurve::NoCurve);
STPoints->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,QColor(Qt::red), QColor(Qt::red), QSize(5, 5)));
STPoints->setYAxis(QwtPlot::yLeft);
STPoints->attach(this);
RPoints = new QwtPlotCurve("R");
RPoints->setStyle(QwtPlotCurve::NoCurve);
RPoints->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,QColor(Qt::yellow), QColor(Qt::yellow), QSize(5, 5)));
RPoints->setYAxis(QwtPlot::yLeft);
//RPoints->attach(this);
legend = new QwtLegend();
legend->setItemMode(QwtLegend::ReadOnlyItem);
legend->setWhatsThis("Click on an item to show/hide the plot");
this->insertLegend(legend, QwtPlot::RightLegend);
samples = new QVector<QPointF>;
data = new QwtPointSeriesData;
replot();
zoomer = new QwtPlotZoomer(QwtPlot::xBottom, QwtPlot::yLeft, canvas());
zoomer->setMousePattern(QwtEventPattern::MouseSelect1, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect3, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect4, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect5, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect6, Qt::NoButton);
}
开发者ID:Aniseed,项目名称:ECG-analyzer,代码行数:59,代码来源:stplot.cpp
示例14: canvas
HistoricPlot::HistoricPlot(QWidget *parent)
:QwtPlot(parent)
{
//Fondo del canvas negro
canvas()->setPalette(Qt::black);
//Auto repintar las curvas
setAutoReplot(true);
setTitle("Historian Variable Plot");
// Grid
m_grid = new QwtPlotGrid;
m_grid->enableXMin( true );
m_grid->setMajorPen( Qt::gray, 0, Qt::DotLine );
m_grid->setMinorPen( Qt::darkGray, 0, Qt::DotLine );
m_grid->attach( this );
//Scale
m_scaleDraw = new QwtDateScaleDraw( Qt::UTC );
m_scaleDraw->setDateFormat( QwtDate::Millisecond, "hh:mm:ss:zzz\nddd dd MMM yyyy" );
m_scaleDraw->setDateFormat( QwtDate::Second, "hh:mm:ss\nddd dd MMM yyyy" );
m_scaleDraw->setDateFormat( QwtDate::Minute, "hh:mm\nddd dd MMM yyyy" );
m_scaleDraw->setDateFormat( QwtDate::Hour, "hh:mm\nddd dd MMM yyyy" );
m_scaleDraw->setDateFormat( QwtDate::Day, "ddd dd MMM yyyy" );
m_scaleDraw->setDateFormat( QwtDate::Week, "Www yyyy" );
m_scaleDraw->setDateFormat( QwtDate::Month, "MMM yyyy" );
m_scaleDraw->setDateFormat( QwtDate::Year, "yyyy");
m_scaleEngine = new QwtDateScaleEngine( Qt::UTC );
//Axis
setAxisTitle( QwtPlot::xBottom, QString( "Time" ) );
setAxisScaleDraw( QwtPlot::xBottom, m_scaleDraw );
setAxisScaleEngine( QwtPlot::xBottom, m_scaleEngine );
setAxisLabelRotation( QwtPlot::xBottom, -50.0 );
setAxisLabelAlignment( QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom );
setAxisTitle( QwtPlot::yLeft, QString( "Value" ) );
//Legend
m_legend = new QwtLegend;
insertLegend(m_legend);
//Zoomer
m_zoomer = new Zoomer( canvas() );
m_zoomer->setMousePattern( QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier );
m_zoomer->setMousePattern( QwtEventPattern::MouseSelect3,
Qt::RightButton );
//Panner
m_panner = new QwtPlotPanner( canvas() );
m_panner->setMouseButton( Qt::MidButton );
resize(800,600);
}
开发者ID:mujicadiazr,项目名称:BDH,代码行数:59,代码来源:historicplot.cpp
示例15: path
CpintPlot::CpintPlot(Context *context, QString p, const Zones *zones, bool rangemode) :
path(p),
thisCurve(NULL),
CPCurve(NULL),
allCurve(NULL),
zones(zones),
series(RideFile::watts),
context(context),
current(NULL),
bests(NULL),
isFiltered(false),
shadeMode(2),
rangemode(rangemode)
{
setAutoFillBackground(true);
setAxisTitle(xBottom, tr("Interval Length"));
LogTimeScaleDraw *ld = new LogTimeScaleDraw;
ld->setTickLength(QwtScaleDiv::MajorTick, 3);
setAxisScaleDraw(xBottom, ld);
setAxisScaleEngine(xBottom, new QwtLogScaleEngine);
QwtScaleDiv div( (double)0.017, (double)60 );
div.setTicks(QwtScaleDiv::MajorTick, LogTimeScaleDraw::ticks);
setAxisScaleDiv(QwtPlot::xBottom, div);
QwtScaleDraw *sd = new QwtScaleDraw;
sd->setTickLength(QwtScaleDiv::MajorTick, 3);
sd->enableComponent(QwtScaleDraw::Ticks, false);
sd->enableComponent(QwtScaleDraw::Backbone, false);
setAxisScaleDraw(yLeft, sd);
setAxisTitle(yLeft, tr("Average Power (watts)"));
setAxisMaxMinor(yLeft, 0);
plotLayout()->setAlignCanvasToScales(true);
//grid = new QwtPlotGrid();
//grid->enableX(true);
//grid->attach(this);
curveTitle.attach(this);
curveTitle.setXValue(5);
curveTitle.setYValue(60);
curveTitle.setLabel(QwtText("", QwtText::PlainText)); // default to no title
zoomer = new penTooltip(static_cast<QwtPlotCanvas*>(this->canvas()));
zoomer->setMousePattern(QwtEventPattern::MouseSelect1,
Qt::LeftButton, Qt::ShiftModifier);
canvasPicker = new LTMCanvasPicker(this);
static_cast<QwtPlotCanvas*>(canvas())->setFrameStyle(QFrame::NoFrame);
connect(canvasPicker, SIGNAL(pointHover(QwtPlotCurve*, int)), this, SLOT(pointHover(QwtPlotCurve*, int)));
configChanged(); // apply colors
ecp = new ExtendedCriticalPower(context);
extendedCPCurve4 = NULL;
extendedCurveTitle2 = NULL;
}
开发者ID:prenard,项目名称:GoldenCheetah,代码行数:58,代码来源:CpintPlot.cpp
示例16: QwtPlot
SweepInspector::SweepInspector(QWidget *parent) : QwtPlot(parent), data(NULL), d_curve(NULL), picker(NULL) {
setObjectName( "SweepData" );
setTitle( "RF Sweep" );
setAxisTitle( QwtPlot::xBottom, "Frequency");
setAxisTitle( QwtPlot::yLeft, QString( "Power Level (dBm)"));
setAutoReplot(true);
enableAxis(QwtPlot::xBottom, true);
enableAxis(QwtPlot::yLeft, true);
enableAxis(QwtPlot::xTop, false);
enableAxis(QwtPlot::yRight, false);
canvas = new QwtPlotCanvas();
canvas->setPalette( Qt::black );
canvas->setBorderRadius(0);
setCanvas(canvas);
//Allow zooming / panning
zoomer = new QwtPlotZoomer( canvas );
zoomer->setRubberBandPen( QColor( Qt::white ) );
zoomer->setTrackerPen( QColor( Qt::white ) );
connect(zoomer, SIGNAL(zoomed(const QRectF &)), this, SLOT(zoomed(const QRectF &)));
panner = new QwtPlotPanner( canvas );
panner->setMouseButton( Qt::MidButton );
//Show the X/Y markers that follow the mouse
picker = new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn, canvas);
picker->setStateMachine( new QwtPickerTrackerMachine() );
picker->setRubberBandPen( QColor( Qt::cyan ) );
picker->setTrackerPen( QColor( Qt::cyan ) );
//FreqdBmPicker *er = new FreqdBmPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn, canvas);
//Setup grid
grid = new QwtPlotGrid();
grid->enableXMin( true );
grid->enableYMin( true );
QColor color(Qt::gray); color.setAlpha(128);
grid->setMajorPen( color, 1, Qt::DotLine );
grid->setMinorPen( color, 1, Qt::DotLine );
grid->attach( this );
//format in kHz, MHz, GHz, not raw values
setAxisScaleDraw(QwtPlot::xBottom, new FreqScaleDraw);
setAxisAutoScale(QwtPlot::xBottom, true);
//setAxisScale(QwtPlot::xBottom, 1, 4.4e9, 4.4e9 / 5.0);
//setAxisScale(QwtPlot::yLeft, -135, 20, 20.0);
setAxisScale(QwtPlot::yRight, 0, 10, 1);
setAxisScale(QwtPlot::xTop, 0, 10, 1);
repaint();
replot();
}
开发者ID:npotts,项目名称:SpectralSignalHound-Viewer,代码行数:55,代码来源:SweepInspector.cpp
示例17: setAxisTitle
void ICResultChart::setOrientation(int orientation)
{
QwtPlot::Axis axis1, axis2;
if (orientation == 0) {
axis1 = QwtPlot::xBottom;
axis2 = QwtPlot::yLeft;
d_barChartItem->setOrientation(Qt::Vertical);
} else {
axis1 = QwtPlot::yLeft;
axis2 = QwtPlot::xBottom;
d_barChartItem->setOrientation(Qt::Horizontal);
}
setAxisTitle(axis2, tr("Number"));
setAxisTitle(axis1, tr("Answers"));
setAxisScaleDraw(axis1, new ChoicesScaleDraw(result.keys()));
setAxisScaleDraw(axis2, new QwtScaleDraw);
int size = result.size()-1 <= 0 ? 0: result.size()-1;
if (size == 0) {
setAxisAutoScale(axis1);
}
else {
setAxisScale(axis1, 0, size, 1.0);
}
int maxsize = 0;
foreach (int size, result.values()) {
if (maxsize < size) maxsize = size;
}
setAxisScale(axis2, 0, maxsize * 1.3);
QwtScaleDraw *scaleDraw1 = axisScaleDraw(axis1);
scaleDraw1->enableComponent(QwtScaleDraw::Backbone, false);
scaleDraw1->enableComponent(QwtScaleDraw::Ticks, false);
QwtScaleDraw *scaleDraw2 = axisScaleDraw(axis2);
scaleDraw2->enableComponent(QwtScaleDraw::Backbone, false);
scaleDraw2->enableComponent(QwtScaleDraw::Ticks, true);
//plotLayout()->setAlignCanvasToScales( true );
plotLayout()->setAlignCanvasToScale(axis1, true);
plotLayout()->setAlignCanvasToScale(axis2, false);
plotLayout()->setCanvasMargin(0);
updateCanvasMargins();
replot();
}
开发者ID:hzzlzz,项目名称:InteractiveCourse,代码行数:54,代码来源:icresultchart.cpp
示例18: QwtPlot
Plot::Plot( QWidget *parent ):
QwtPlot( parent )
{
setObjectName( "FriedbergPlot" );
setTitle( "Temperature of Friedberg/Germany" );
setAxisTitle( QwtPlot::xBottom, "2007" );
setAxisScaleDiv( QwtPlot::xBottom, yearScaleDiv() );
setAxisScaleDraw( QwtPlot::xBottom, new YearScaleDraw() );
setAxisTitle( QwtPlot::yLeft,
QString( "Temperature [%1C]" ).arg( QChar( 0x00B0 ) ) );
// grid
QwtPlotGrid *grid = new Grid;
grid->attach( this );
insertLegend( new QwtLegend(), QwtPlot::RightLegend );
const int numDays = 365;
QVector<QPointF> averageData( numDays );
QVector<QwtIntervalSample> rangeData( numDays );
for ( int i = 0; i < numDays; i++ )
{
const Temperature &t = friedberg2007[i];
averageData[i] = QPointF( double( i ), t.averageValue );
rangeData[i] = QwtIntervalSample( double( i ),
QwtInterval( t.minValue, t.maxValue ) );
}
insertCurve( "Average", averageData, Qt::black );
insertErrorBars( "Range", rangeData, Qt::blue );
// LeftButton for the zooming
// MidButton for the panning
// RightButton: zoom out by 1
// Ctrl+RighButton: zoom out to full size
QwtPlotZoomer* zoomer = new QwtPlotZoomer( canvas() );
zoomer->setRubberBandPen( QColor( Qt::black ) );
zoomer->setTrackerPen( QColor( Qt::black ) );
zoomer->setMousePattern( QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier );
zoomer->setMousePattern( QwtEventPattern::MouseSelect3,
Qt::RightButton );
QwtPlotPanner *panner = new QwtPlotPanner( canvas() );
panner->setMouseButton( Qt::MidButton );
canvas()->setPalette( Qt::darkGray );
canvas()->setBorderRadius( 10 );
}
开发者ID:BryanF1947,项目名称:GoldenCheetah,代码行数:53,代码来源:plot.cpp
示例19: QwtPlot
PlotHRVTriangle::PlotHRVTriangle(QWidget *parent) :
QwtPlot(parent)
{
setMinimumHeight(10);
setMinimumWidth(10);
setAxisTitle(QwtPlot::xBottom, "TINN [s]");
setAxisTitle(QwtPlot::yLeft, "Liczba wszystkich odstępów RR");
rr = new QwtPlotCurve("RR");
rr->setStyle(QwtPlotCurve::Sticks);
rr->setOrientation(Qt::Orientation::Vertical);
rr->attach(this);
xn = new QwtPlotCurve("X-N");
xn->setPen(QPen(Qt::darkGray, 0, Qt::DashLine));
xn->attach(this);
xm = new QwtPlotCurve("X-M");
xm->setPen(QPen(Qt::darkGray, 0, Qt::DashLine));
xm->attach(this);
mx = new QwtPlotMarker();
mx->setLineStyle(QwtPlotMarker::VLine);
mx->setLabel(tr("X"));
mx->setLabelAlignment(Qt::AlignLeft | Qt::AlignTop);
mx->setLinePen(QPen(Qt::gray, 0, Qt::DashLine));
mx->attach(this);
my = new QwtPlotMarker();
mx->setLineStyle(QwtPlotMarker::HLine);
mx->setLabel(tr("Y"));
mx->setLabelAlignment(Qt::AlignRight | Qt::AlignTop);
mx->setLinePen(QPen(Qt::gray, 0, Qt::DashLine));
my->attach(this);
mn = new QwtPlotMarker();
mx->setLineStyle(QwtPlotMarker::VLine);
mx->setLabel(tr("X"));
mx->setLabelAlignment(Qt::AlignLeft | Qt::AlignBottom);
mx->setLinePen(QPen(Qt::gray, 0, Qt::DashLine));
mn->attach(this);
mm = new QwtPlotMarker();
mx->setLineStyle(QwtPlotMarker::VLine);
mx->setLabel(tr("X"));
mx->setLabelAlignment(Qt::AlignRight | Qt::AlignBottom);
mx->setLinePen(QPen(Qt::gray, 0, Qt::DashLine));
mm->attach(this);
}
开发者ID:Aniseed,项目名称:ECG-analyzer,代码行数:51,代码来源:plothrvtriangle.cpp
示例20: QwtPlot
MyPlot::MyPlot( const QwtText& name, QWidget *parent )
: QwtPlot( name, parent )
{
// Show a title
setTitle( "This is an Example" );
QwtLegend * legend= new QwtLegend();
// Show a legend at the bottom
insertLegend(legend, QwtPlot::BottomLegend);
// Show the axes
setAxisTitle( xBottom, "x" );
setAxisTitle( yLeft, "y" );
// Insert two curves and get IDs for them
QwtPlotCurve *curve1 = new QwtPlotCurve("y = sin(x)");
QwtPlotCurve *curve2 = new QwtPlotCurve("y = sign(sin(x)");
// Calculate the data, 500 points each
const int points = 500;
double x[ points ];
double sn[ points ];
double sg[ points ];
for( int i=0; i<points; i++ )
{
x[i] = (3.0*3.14/double(points))*double(i);
sn[i] = 2.0*sin( x[i] );
sg[i] = (sn[i]>0)?1:((sn[i]<0)?-1:0);
}
// Copy the data to the plot
curve1->setData( x, sn, points );
curve2->setData( x, sg, points );
// Attach
curve1->attach( this );
curve2->attach( this );
// Set the style of the curves
curve1->setPen( QPen( Qt::blue ) );
curve2->setPen( QPen( Qt::green, 3 ) );
// Show the plots
replot();
}
开发者ID:baloo,项目名称:wiidrums,代码行数:51,代码来源:plot.cpp
注:本文中的setAxisTitle函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论