TikZ' datavisualization
library and the package pgfplots
(based on TikZ) both produce pretty nice plots in LaTeX. To someone starting to do that, what are the differences between the two and what may make one preferable to the other?
There is this question from 2012 and this one from 2014 basically asking the same question.
- In the 2012 one the answer is that
datavisualization
is still experimental and thus recommends usingpgfplots
. - In the 2014 answer states that both are reasonable options. The differences pointed out here are
pgfplots
is more maturedatavisualization
is a bit more verbose
So, what is the current state of affairs? As a start, here are my thoughts after skimming through both documentations. Please expand on them and correct me, where I got the wrong impression.
pgfplots
seems to support more plot types by default.- In
datavisualization
it seems to be very easy to add new plot types. Is the same true forpgfplots
? datavisualization
is an inbuilt solution. This guarantees a very high degree of interoperability and consistency in the syntax with the rest of TikZ.- Both seem to come with very nice defaults.
- I assume that both allow changing every aspects of how each elements of the plot is visualized.
pgfplots
has a much larger user base, which means more help here.- Are there any differences in the capability to handle large amounts of input data?
- Since
datavisualization
was added to TikZ afterpgfplots
already existed, I assume that the author deemed some of the design choices inpgfplots
suboptimal.
datavisualization
. At least on GitHub there are only very few bug reports for that component. On top I think it doesn't work withfpu
, so the precision and accessible data range is very limited.pgf
’s standard representation of numbers and TeX dimensions and is does not use the standard parser when reading numbers in a data point. Instead, thefpu
library, described in Section 56, is used to handle numbers."! Dimension too large
withdatavisualization
than withpgfplots
.\addplot3
. So you may want to specify the application range.pgfplots
makes use of stuff that is part ofpgfplotstable
, too, which allows you to draw the stuff in the foreground last, such that it really looks 3d-like. This is a highly nontrivial achievement IMHO which for me makes the choice easy. If I was sure that I only need 2d plots, this question would be more delicate. Note also that I do not believe that the motivation fordatavisualization
was that there was something wrong withpgfplots
.