Is there documentation for which functions work as pgfplots expressions (like sin, cos, exp, etc.) The pgfplots documentation doesn't seem to say anything on what you can/can't use.


The pgfplots package uses pgfmath expressions from the pgf package. See the TikZ/PGF manual (pgfmanual.pdf) in part VI, section 63 "Syntax for mathematical expressions", page 527 in PGF v2.10 for a list of all available PGF math expressions. You can also add your own, but some programming is required for that.

  • I'm not sure that pgfplots uses all the pgfmath functions of the pgf 2.1 version. I have the impression that pgfplots uses the functions of pgf 2.0 and I'm not sure that you can use in pgfplots a personal function created with pgfmathdeclarefunction. Perhaps I'm wrong but if you have an example I think a lot of users will be happy ! I have some difficulties with the english language but there is pgfplotstodo document somewhere ... – Alain Matthes Apr 10 '11 at 9:24
  • @Altermundus: AFAIK pgfplots passes the math expressions to pgf in whatever version installed and uses the return value. This would allow for all available functions including self-defined ones. However, I didn't tested that by myself. – Martin Scharrer Apr 10 '11 at 9:31
  • I sent an email to Christian Feuersaenger. I hope he has enough time to give an answer because my first tests are negative. – Alain Matthes Apr 10 '11 at 9:36
  • PGFPlots uses the fpu library of pgf -- which is supposed to contain all math functions. But it might happen that some new functions need to be ported to the fpu. Can you send me an example? Perhaps I can improve some things. – Christian Feuersänger Apr 18 '11 at 20:50
  • @Feuersaenger: I think you mean Altermundus, don't you? You need to add @Altermundus in your comment so that he gets notified. – Martin Scharrer Apr 18 '11 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.