Graphics, Figures & Tableschanging labels on axes

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

changing labels on axes

Post by coachbennett1981 »

Good afternoon, I am looking to change the vertical axes to letters in the alphabet. For example the first vertical axis I would like to read B,C,D,A. Is there a quick way to fix this? I was wondering if I had to use the uput feature, for each axis, but that can be tedious. Any thoughts would be appreciated.

Code: Select all

\documentclass{article}
\usepackage{pstricks-add}
\usepackage{multicol}
\usepackage{color}

\begin{document}
\begin{multicols}{4}
\psset{unit=.5in}
\begin{pspicture}(1,5) 
\psaxes[xAxis=false,linecolor=red]{->}(0.5,0)(0.5,5) 
\end{pspicture}
\end{document}

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

changing labels on axes

Post by CrazyHorse »

coachbennett1981 wrote:Good afternoon, I am looking to change the vertical axes to letters in the alphabet. For example the first vertical axis I would like to read B,C,D,A. Is there a quick way to fix this? I was wondering if I had to use the uput feature, for each axis, but that can be tedious. Any thoughts would be appreciated.

Code: Select all

\documentclass{article}
\usepackage{pstricks-add}
\newcounter{lC}
\setcounter{lC}{1}

\begin{document}

\psset{unit=.5in}
\begin{pspicture}(1,5)
  \psaxes[labels=none,xAxis=false,linecolor=red]{->}(0.5,0)(0.5,5)
  \psforeach{\yL}{B,C,D,A}{\uput[180](0,\value{lC}){\yL}\stepcounter{lC}}
\end{pspicture}

\end{document}
by the way: it may be a good idea, if you can test your code, before
posting it ...

Herbert
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: changing labels on axes

Post by coachbennett1981 »

Not sure for why I would not have checked my code before posting this. I always do and it works fine. I post questions from files that I have run and see mistakes. Did it not work for you?

Nick
Post Reply