How do PStricks and TikZ compare for ease of learning and for quality of API design?

13,016

Solution 1

Quick answer: I prefer TikZ to pstricks because I think TikZ

  • is better designed
  • is easier to learn
  • is compatible with pdftex
  • gives you more power and abstraction (you don't have to specify as many coordinates by hand)
  • lets you create more beautiful graphics with the same effort
  • it is easier to extend using TeX programming (it was designed from the ground up with extensibility in mind)

For the users of pstricks, I'd recommend writing all new documents using TikZ in the future. For the users of METAPOST, if their graphics don't use linear equation solving, I'd recommend TikZ. If the METAPOST graphics needs linear equation solving, I'd suggest trying Asymptote.

pstricks does indeed give you the power of PostScript, but it is not PostScript which makes your graphics authoring powerful, but it is abstraction: the use of automatic positioning, automatic intersection calculations, and display style templates. TikZ gives you powerful abstractions, even if you are not a programmer, or you are not willing to program this time.

I don't have experience writing TikZ extensions, but from a quick glimpse of the TikZ source code, it seems to be easy to understand and extend, compared to other TeX macro packages I came across.

Solution 2

As a fond user of TikZ I have been having this debate with a professor in my physics department who loves pstricks and I think we have come to a conclusion as I have stated in other posts. Absent a few times when dipping into the PS itself, TikZ and pstricks are very comparable in most ways. The extensibility and compatibility of TiKZ is appealing leading us to agree that:

  • We think that new users should learn TikZ.
  • Old hands at pstricks probably wont gain enough from the switch and may not be worth doing.

Hopefully that helps!

Solution 3

I've only ever used PSTricks, but I've made it do everything I want it to do. Tikz has a great-looking manual and is clearly very powerful. There are two things that I would want out of a drawing system that I can't do with PSTricks: feathered edges (which Tikz can do), and I can't remember the other thing. OP was asking about 'ease of learning': PSTricks certainly requires some trial and error, and I think some coding discipline which I'm not very good at. But \rput is pretty central to how I use PSTricks.. I can't imagine being without it.

On the other hand, 'decorations' look pretty neat. I like the 'saved from trash' example on page 210 (!) of the (560 pp. total) manual. I don't like the fact that Tikz seems to use an entirely different notation -- I don't recognize LaTeX in it which makes it seem foreign and weird. The manual looks beautiful, though. The transparency and 'fade' effects seem very powerful .. can that be done in pstricks? .. but I doubt that I would ever use them. Tikz seems a bit more on the "drawing" end of things. As a rule, I don't make drawings, I make figures.

Can you do arithmetic on coordinates? I'd have to start over and learn from scratch to use Tikz, which is a tough sell if I'm not even sure what I would get out of it.

Solution 4

I am developing an asp.net application working with Miktex distribution installed on the server.

The application will generate math problems and produces pdf files to be downloaded by the visitor. The math problems contain some jpeg images and mathematical diagrams.

I was confused whether to use PSTricks or Tikz. After benchmarking the application, I must use Tikz because it needs only one compilation step using pdftex. So Tikz wins in this scenario. :D

Note: I hope my answer matches your question :D

Solution 5

I think pstricks is superior. TikZ doesn't even have a good way of translating coordinates, like the rput/uput/Aput/Bput pstricks commands. You can use xshift and yshift, but these require units (!), so scaling the image will require manually shaling every xshift/yshift call.

Share:
13,016
Norman Ramsey
Author by

Norman Ramsey

Every time I see a question about "strong" or "weak" typing, I kill a kitten.

Updated on June 14, 2022

Comments

  • Norman Ramsey
    Norman Ramsey about 2 years

    My group uses Literate Programming for most of our source code---this means that internal documentation is written using LaTeX. We have been using PStricks for fancy technical diagrams of the system, but have recently been recommended to use TikZ. I've gathered this information:

    • TikZ/PGF is new and maintained; PStricks went a long time without a maintainer but has received some maintenance in the last couple of years.
    • TikZ works with many back ends, including (for those who care) pdftex. PStricks works only with dvips.
    • PStricks is more powerful and expressive than TikZ. In a dire emergency you even have the full power of PostScript.
    • PStricks has a significant ecology of extra packages that have been built on top of it; TikZ is too new to have many such things.
    • TikZ claims to have been designed "with the shortcomings of PStricks in mind." The author does not specify which shortcomings.

    I'm interested in the answers to two questions. If you wish, feel free to post one answer per question:

    • What is the learning curve like for the two tools? (I consider PStricks to have a steep learning curve; about TikZ I am uninformed.)

    • Considered as programming APIs, is one of these two packages significantly better designed than the other? If so, which is the better design, and why? (What properties does it have that make you consider it better?)

    To make a compelling argument why one API is better than another, you may want to resort to examples.