本文整理汇总了C++中setAxisTitle函数的典型用法代码示例。如果您正苦于以下问题:C++ setAxisTitle函数的具体用法?C++ setAxisTitle怎么用?C++ setAxisTitle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAxisTitle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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 );
}
示例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();
}
}
示例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 );
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}