I am using Qwt now for two years. I like its object oriented classes, which makes it very easy to adapt the plots and functionality. These days QCustomPlot is becoming more and more popular and competes with Qwt. Of course I did compare the APIs. However I am interested in the testimonies of experienced users from both libraries. What is convenient? What not? Are there any pitfalls?
I wouldn't call myself "experienced", as I used Qwt only for a few months, and QCustomPlot for a few weeks. That being said, my impressions are:
- QCustomPlot seems to be more actively developed at present. Last release was in August 2012 (whereas last release of Qwt dates back to 2011). Subjectively, its interface seems more 'aligned' with Qt framework.
- Qwt, on the other hand, seems more mature and featureful. For instance, current release of QCustomPlot has no straightforward way to set the colour background for the axis rectangle (only setting background to a user-supplied pixmap is supported). Another example - Qwt has special classes and methods to facilitate plotting and zooming in-out the curves with a very large number of points. I found nothing like that in QCustomPlot.
EDIT: Author of QCustomPlot is aware of missing functionality to set plot background and promises to add it in upcoming release.
There's also another important difference between QCustomPlot and Qwt - licensing. - Qwt is LGPL, so you can link it into non-GPL project. QCustomPlot is GPL v.3, which many people (myself included) find WAY too restrictive. QCustomPlot author invites to contact him if you want LGPL license.
EDIT2 (25 March 2013): New releases of Qwt branches 5.* and 6.* appeared in November, which annuls "more actively developed" advantage of QCustomplot
I can't compare both libraries since I only use QCustomPlot (for a year now) but I believe my comment may be useful to other nevertheless.
Pros of QCustomPlot:
- Publicly availabe on Gitorious,
- Living user base willing to help out (including the autor himself),
- Openness to LGPL licensing (in exchange for a donation, in my case),
- Very clean and concise interface,
- Very easy to find a bug, if present (my bugfixes were rarely longer than one line)
- Easy to extend;
- Very hackable into whatever you'd like to smash out of a cartesian plotting library,
- Good documentation,
- Available in condensed form of 1 .h and one .cpp file - handy for quick integration or purpose-built one-widgeters,
- Very good performance (in all of my use cases),
- It's obvious that the author likes nice code and can produce one,
- Very well thought out road map (for a loong time to come).
Cons of QCustomPlot:
- Very strictly cartesian (read: no pie charts),
- In my case took some time to get the necessary grip of all things important (if one likes to implement extensions of comparable quality to the basis),
- Maybe a little slow evolution (as many other one-busy-man projects),
- Only usable in main thread (i. e. when you need to generate pictures in, say, multithreaded webserver, you need to run this library in the main thread, whatever that means for your implementation).
If LGPL-ish license is required, there may not be a free of charge option (depends on the consideration of the author). Given the quality and usability of the library, the donation my company gave in exchange for the LGPL license agreement was not undue.
When Plotting lots of points. and user concentrate the point to whole plot. ie (x, y axis is fully covered with pixels)
(points count = given below calculation)
while dragging the plot:
- Qwt give a way lot better performance over QCustomPlot.
- QCustomPlot drag/replotting lags way more than Qwt and that is bad for UI.
- Qwt lag is ignorable and is acceptable.
- Qwt require less processing.
What i noticed is: while dragging, Qwt only drags the plot area and after dropping it draw on the area. whereas QCustomPlot try to replot before dropping. (note sure but this could help QCustomPlot guys make it better.)
Also, Qwt provide raw buffer option that can be managed externally. i was able to decrease (QcustomPlot)150Mb to less that (Qwt)40Mb. keeping,
QCustomPlot force user to allocate memory to X axis (errorbar+ , errorbar-), y axis (errorbar+, errorbar-) (2 * 2 * sizeof(double)) memory is wasted out of 3 * 2 * sizeof(double) ie 32byte out of 48byte is waste (for 1sample) where as only Qwt required 16byte for one sample (for x, and y).
afai understand, errorbar can be achieved in Qwt also
- equal number of points (96KiloSamples/sec * 10second buffering = 96 * 1000 * 10 = ~1M)
- Anti-aliasing disable in QCustomPlot and enabled in Qwt
- Same re-plotting algorithm. (take data at same interval of time from device and fire replot afterwards)
even after Anti-aliased enabled, Qwt was way much better in performance.
NOTES:
- Qwt is mature, efficient.
- QCustomPLot give better look and feel. (slightly better than Qwt.)
Qwt can be made much more good looking just after changing it background to white, antialiased enabled and grids
Tested on:
- Qwt 6.1.0 compiled for Qt5
- QCustomPLot 1.2.1 compiled for Qt5
- Qt5.2.1
- Linux localhost.localdomain 3.13.11-100.fc19.x86_64 #1 SMP Wed Apr 23 20:10:57 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
- i3-3120M CPU @ 2.50GHz x 4
also, QCustomPlot peform same on Qt4.
these are my finding, and may vary from conditions to conditions.
i have switch back to Qwt. hope this help others in selecting. :)
minor:
- Con QCustomPLot require seperate qmake file to be downloaded. (frustrating for starters)
- Con Qwt has multiple file to be compiled.
- Pro QCUstomPlot has only two files : source and header
- Con Neither channel have IRC channel (atleast not on Freenode)
- Con QCustomPlot has multiple example pushed into one executable.
- Pro Qwt has many examples distributed over many executables
- Con QCustomPlot dont have any QtCreator Plugin
- Con QCustomPlot is not available in repo (atleast not on Fedora 19)
- Pro Qwt has lot of other goodies
- Con Qwt is bulky :p
- Pro Qwt support CMake
- Pro Qwt is much more flexible (afaif)
please correct me if im wrong on some points.
Pros:
- Easy to get started IMO (The API is intuitive and well documented)
- Good plot quality and fast response when panning and zooming.
- Single .h/.cpp file (i.e. no need to reference compiled libraries other than QTs)
Cons:
- GPL (not LGPL)
- Internally uses a data structure that stores 6
double
s for each data point even when you only needX
andY
- Internally it uses a
QMap
to store the data points and keep them sorted. Very efficient for panning and zooming but very slow to populate when the number of samples is large (e.g. 1,000,000 data points)
来源:https://stackoverflow.com/questions/13067411/what-are-the-advantages-disadvantages-of-qcustomplot-compared-to-qwt