I was wondering why a tikz/pgf plot of a data file containing several thousand data points needs a couple of minutes to compile while creating the same plot with a WYSIWYG plotting tool (like Grace) or spreadsheet application (like MS Excel or Origin) needs only seconds. What are the WYSIWYG applications doing differently from tikz to be so much faster?
|
|
|||
| show 2 more comments |
|
Apart from reading out data files, typesetting of data also involves floating point operations, such as transformation of data points into the coordinate system of the output medium (document page). By design, TeX has only very limited support for floating point operations. They must be implemented on top of it as macros (Pgf, fp, LaTeX3) or delegated to the next conversion step of the document creating work flow (PSTricks). Obviously, mathematical operations like sin or exp are much slower if implemented as macros. Nevertheless, TikZ/PGF can be configured to do the plotting step only once for every graph. Repeated document compilation then uses the existing graphics files of the plots. |
|||||||
|
|
Another issue is the |
|||
|
|
.pdfto make a fair comparison. – percusse Jan 23 '12 at 10:03.pdfworks almost instantaneously. – Philipp Jan 23 '12 at 10:20pdfinstead of having to position every element separately. Note that you can makeTikZusegnuplotto do the plotting, which should speed things up considerably. – Roelof Spijker Jan 23 '12 at 10:59pdfis still vectorized? – Philipp Jan 23 '12 at 11:09.pdfimage point by point whereas the others use lots of readily available and RAM-loaded libraries for these, even taking advantage of the graphics card's GPU in some cases. Hence it is not just an algorithm issue. – percusse Jan 23 '12 at 11:14