Graphics, Figures & Tableslabeling axes in pstricks

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Mini
Posts: 73
Joined: Thu Aug 06, 2009 12:46 pm

labeling axes in pstricks

Post by Mini »

Hello,

Is there a better way to label the x and y axes other than using rput?

ie. is there a better way than doing something like:

Code: Select all

\begin{figure}[!htb]
    \begin{pspicture}(-5,-5)(10,10)
      \psaxes[linewidth=1.2pt, labels=all]{->}(0,0)(-5,-5)(10,10)
      \pscurve[showpoints=true](-5,-5)(1,0.25)(5,9)(10,10)
      \rput(10,-0.25){$x$}
      \rput(-0.25,10){$y$}
    \end{pspicture}
\end{figure}
Thanks
Last edited by Mini on Fri Dec 10, 2010 5:19 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

labeling axes in pstricks

Post by localghost »

Please always provide a minimal example.
Mini wrote:[…]Is there a better way to label the x and y axes other than using rput? […]
According to the pst-plot manual (Section 1, p. 10) there is one.

Code: Select all

\documentclass{minimal}
\usepackage{pst-plot,pstricks-add}

\begin{document}
  \begin{pspicture}(-5,-5)(10,10)
    \psaxes[linewidth=1.2pt, labels=all]{->}(0,0)(-5,-5)(10,10)[$x$,-90][$y$,-180]
    \pscurve[showpoints=true](-5,-5)(1,0.25)(5,9)(10,10)
  \end{pspicture}
\end{document}

Thorsten
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

labeling axes in pstricks

Post by CrazyHorse »

Mini wrote: Is there a better way to label the x and y axes other than using rput?
ie. is there a better way than doing something like:
the default way is what Thorsten already posted. However, placing
objects to specific horizontal or vertikal lines is easier with
\uput, e.g. \uput[-90](10,0){$x$}

Herbert
Post Reply