QCustomPlot Discussion and Comments

Adaptive SamplingReturn to overview

If we are using a QCPGraph with adaptive sampling enabled, what would the maximum number of points being plotted on the graph be? I'm assuming there isn't a point per piece of data since the data starts collasping (1 point per pixel, 2 points per pixel, etc.). I guess I'm wondering if I run through 30 million points with adaptive sampling on why does it still get sluggish once we hit the 10's of millions?

QCustomPlots adaptive sampling saves 90% and more of the time required to draw graphs with millions of data points, without losing visual information. The last part is the important thing. After bisecting the relevant portion of the data by key axis range, it goes through all the data points that are left (which might still be millions) to effectively form an envelope of the data, and only draw that.

Naturally, once you hit 30, 40 or 50 million data points, this process which is unrelated to drawing, will consume noticeable time depending on your system performance.

The only alternative would be to provide a sparse sampling feature which simply skips over data points. Downside would be that you lose the visual fidelity to the original data. Would that feature be interesting for your use case?

Thanks for the explanation. We can't use sparse sampling either because they want all the data to be visible. Once I converted my application to x64 I was able to plot 110 million data points on a plot and I had 2 plots (220 million data points in total). The application grew to 16GB but it still ran without crashing, this test was probably 2X more than we would see in the field. Once I ran it with a normal data set of 50 million per plot it grew to 7GB and is a little sluggish when resizing, but I don't think the end user would be too unhappy with it.

If you have a solution for this problem, I could cut my data points in half. I have to be able to draw the data points in red and then about halfway through I need to draw them in blue but leave the first half red. The only way I've found to do this so far is to have 2 graphs on the plot and the invisible one is plotting qNan() until it is needed and then they flip, but this causes twice as many points.

Or is there an easy way to store some of the data to disk instead of having it all in RAM? I'm worried not all the PCs that will run this application will have enough memory.

This is an awesome library to work with. It does almost anything you need it to, that's why I'm thinking I'm missing something simple that I haven't found yet.

Thanks for all of your hard work!