TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The objective is to get fractional labels (not in decimal) for both vertical and horizontal axes.

In my experience, non-trigonometric labels are written in decimals and trigonometric labels can be written in fractional via trigLabels and trigLabelBase. I attempted to abuse these keys to get fractional non-trigonometric by using \let\pi=\relax, but it causes a problem where

  • \pi/n becomes /n (that should be 1/n),

  • -\pi/n becomes -/n (that should be -1/n),

  • -\pi becomes - (that should be -1),

  • \pi becomes <empty> (that should be 1) where <empty> stands for empty .

My question, what is the best trick to convert every \pi to relax but prevent the problems from happening?






enter image description here

More general case

Sometimes I need to change \pi to \sqrt{2}, for example. I tried with


but it does not compile.

share|improve this question
up vote 2 down vote accepted

The version 1.71 from http://texnik.dante.de/tex/generic/pst-plot/ knows fractionLabel:



However, there is a spurious space which needs some more investigation.

enter image description here

share|improve this answer
Sorry, is it possible to change \pi with e, \sqrt{m}, etc such that we can have \frac{e}{n}, \frac{\sqrt{m}}{n}, etc where n is the fractionLabelBase? – kiss my armpit Aug 24 '14 at 9:33
for example: xlabelFactor=\sqrt{2} or \def\pi{e} – Herbert Aug 24 '14 at 9:38
Sorry. Using xlabelFactor makes the factor appear on the right of the fractional labels rather than in the numerator of the fractional labels. As a result, there are some "oddities" such as -1\sqrt{2} and 1\sqrt{2}. It will be better if we can change \pi in the numerator with \sqrt{2}, for example. – kiss my armpit Aug 24 '14 at 9:49
\def\pi{\sqrt{2}} for example – Herbert Aug 24 '14 at 9:57
The update of pst-plot was done on August 24 but up to now it has not been propagated to TeXLive mirrors. A weird thing happened: pst-poly updated on August 28 has been propagated to TeXLive mirrors. – kiss my armpit Sep 1 '14 at 19:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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