JKQtPlotter/examples/jkqtplot_test/TestWidgetEmptyPlot.cpp
jkriege2 0e2237e92f - more refactorings to modernize C++
- fixed JKQTPColumnMathImage with modifiers
- improved documentation
- make use of link_prl/create_prl in QMake projects (see http://doc.qt.io/qt-5/qmake-advanced-usage.html)
2019-01-26 18:00:42 +01:00

34 lines
793 B
C++

#include "TestWidgetEmptyPlot.h"
#include <QDebug>
#include <QDate>
#include <QDateTime>
#include <QApplication>
TestWidgetEmptyPlot::TestWidgetEmptyPlot(QWidget *parent) :
QWidget(parent)
{
#define NEMPTY 500
JKQTPlotter* plotEmpty=new JKQTPlotter(true, this);
JKQTPXYLineGraph* efunc=new JKQTPXYLineGraph(plotEmpty->getPlotter());
double xef[NEMPTY], efy[NEMPTY];
for (int i=0; i<NEMPTY; i++) {
xef[i]=i;
efy[i]=double(i%5)*1e-308;
}
efunc->setXColumn(plotEmpty->getDatastore()->addCopiedColumn(xef, NEMPTY, "x"));
efunc->setYColumn(plotEmpty->getDatastore()->addCopiedColumn(efy, NEMPTY, "y"));
plotEmpty->addGraph(efunc);
plotEmpty->getYAxis()->setLogAxis(true);
plotEmpty->zoomToFit();
plotEmpty->setY(0,0);
}