QCustomPlot Discussion and Comments

PDF output jagged edgesReturn to overview


I have used the excellent text-document-integration demo to output my plots to PDF. I produce an A4 page containing a grid of plots each approx 35mm square. The plots themselves each contain around 5000 data points.

The idea is that the complete PDF page can be printed (to paper) for an overview and record of all of the plots but the PDF can also be viewed on screen and the user can zoom in to view each plot in fullscreen and, due to the vector format, get to see more detail than is immediately obvious when viewing something 35mm wide.

The issue I'm experiencing is that whilst the plots look almost OK when small, when zooming in its is immediately obvious that there are some artefacts on every falling edges of the plotted data. Any part with a negative gradient is plotted as a jagged saw tooth.

If I produce a single plot A4 size then it resembles the original data much better but again if I zoom in i can still see this issue with jagged edges.

I'm confused as to where this artefact is introduced in the plot -> painter -> printer chain. Could it be related to antialiasing or adaptive sampling?

My question is whether anyone can give any pointers as to where I should I be looking in order to remove this artefacting and also how I can control the number of points plotted in each point independently of its on page size?


After struggling for ages I solved it within minutes of finally asking for help

customPlot->graph(0)->setAdaptiveSampling(false); (for each graph)

This results in the very high quality output i was looking for but still maintains sensible file sizes.

I had similar issue that plot (displayed on screen) was jagged on sharp edges. Setting adaptive sampling to false was sufficient to fix it.