6

I am new to PSTricks and want to plot some functions. The documentation of pst-plot explains (but not detailed enough) both \psgraph environment and the combination of \pspicture and \psaxes. The thing I want to know is:

When should I use one rather than the other one?

Bonus question: I want to change the font of the axis labels from text to math. How can we do that?

\documentclass{minimal}
\usepackage{pst-plot}

\begin{document}
\begin{psgraph}[]{->}(0,0)(-1,-2)(\psPiTwo,2){8cm}{6cm}
    % plotting 
\end{psgraph}
\end{document}

Output:

enter image description here

1
  • @Werner: Thank you very much for the useful comment. It really solved the problem.
    – Stupid Boy
    Feb 27 '13 at 7:43
5

Since they are interchangeable, there should be no problem using either one or the other.

You should be able to change the x/y labels using

\psset[pst-plot]{xAxisLabel=$x$,yAxisLabel=$y$}

Here is a complete MWE:

enter image description here

\documentclass{article}
\usepackage{pst-plot}% http://ctan.org/pkg/pst-plot
\begin{document}
\psset[pst-plot]{xAxisLabel=$x$,yAxisLabel=$y$}
\begin{psgraph}[]{->}(0,0)(-1,-2)(\psPiTwo,2){8cm}{6cm}
    % plotting 
\end{psgraph}
\end{document}

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.