QCustomPlot Discussion and Comments

Why a default frame is necessary? Return to overview


I am crating a window which later can be filled by a plot (commented out below).
To my surprise, a default scale appears, from 0 to 5, and no plot.
This would not really necessary, until no functionality requested.
Is it some spacekeeper or forgotten debug contribution?

If I uncomment the demo line, everything is OK.

Window::Window(QCustomPlot *plotter, QWidget *parent) :
    QMainWindow(parent)
{
    spectrumPlot = plotter;
    resize(1000, 800);
//    setupSincScatterDemo(spectrumPlot);
}

If you copied code from the plot demo, of course you're going to get a plot when you call setupSincScatterDemo. ;)

Other than that, the default initial state of QCP is to have the main axis rect with four axes (left, right, top, bottom), with right and top axes' visibility set to false. That's a sensible initial state for the big majority of use cases. If you don't like that, feel free to remove the main axis rect via customPlot->plotLayout()->clear();. Then you'll have a completely white widget, if that's what you're looking for.