[pstricks] Special x-axis values

Christoph Bersch usenet at bersch.net
Wed Jul 25 10:04:15 CEST 2007


Hi,

I want to use special x-axis values like it's shown in 
http://tug.org/PSTricks/main.cgi?file=pst-plot/psaxes#ChemElements.

My problem now is, that I have a datafile that I want to plot, and the 
x-values are in the range from -0.5 to 0.5 and the x-axis should have 
the values
-T/2 -T/4 0 T/4 T/2

The following does not work properly as the indexing of the label array 
is wrong. How do I have to change the example?

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{pstricks-add}

\makeatletter
\def\pst@@@hlabel#1{\small\textcolor{red}{\NewYLabels(#1)}}
\makeatother
\usepackage{arrayjob}
\usepackage{nicefrac}
\begin{document}
%
\newarray{\NewYLabels}
\readarray{NewYLabels}{\nicefrac{T}{2} & -\nicefrac{T}{4} & 0 & 
\nicefrac{T}{4} & \nicefrac{T}{2}}
%
\psset{xunit=10cm}
\begin{pspicture}(-0.5,-3)(0.55,3)
\psset{Dx=0.25}
\psaxes{->}(-0.5,0)(-0.5,-3.5)(0.55,3.5)
\end{pspicture}
\end{document}

Thank you,
Christoph



More information about the PSTricks mailing list