[pstricks] Labels on x-axis

Martin Chicoine martin.chicoine at umontreal.ca
Mon Mar 12 18:03:41 CET 2007


Ok, thanks a lot!

Another thing : in my example, I set the tick width manually (.5pt). how can
I get the subgridwidth? I tried [linewidth=\psk at subgridwidth] but it doesn't
give the right width.

Martin.

-----Message d'origine-----
De : pstricks-bounces at tug.org [mailto:pstricks-bounces at tug.org] De la part
de Herbert Voss
Envoyé : 12 mars, 2007 11:19
À : Graphics with PSTricks
Objet : Re: [pstricks] Labels on x-axis

Martin Chicoine schrieb:
> I created the < \psxpoint > command to put labels at arbitrary positions
on
> the x-axis. It works ok but I have to add the factor 1.84ex in order to
> align the label. So if I change font or something else, it doesn't align
> well anymore. What parameter should I put there instead?
>
>   
you have to use the [t] option for \rput. However, with \rput(! ...
you do not need to define a new length.


\documentclass{article}

\usepackage{mathptmx,pstricks-add}

\makeatletter
\newcommand{\psxpoint}[2]{%
  \psline[linewidth=.5pt]{-}(#1,\pst at xticksizeB)(#1,\pst at xticksizeA)
  \rput[t](! #1 \pst at number\pslabelsep \pst at number\pst at xticksizeB add
    \pst at number\psyunit div neg ){#2}}
\makeatother
\begin{document}

\begin{psgraph}[arrows=->](0,0)(-1,-2)(4,2){.5\textwidth}{!}
  \psplot[algebraic]{0}{4}{sin(x)}
  \psxpoint{1.5}{$2x_0$}
\end{psgraph}

\end{document}


Herbert
_______________________________________________
pstricks mailing list
pstricks at tug.org
http://tug.org/mailman/listinfo/pstricks




More information about the PSTricks mailing list