Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

See below for the code that generates the image below. How do I move the x labels out of the way to the left, but move the zero to the right?

\documentclass[border=12pt]{standalone}
\usepackage{pstricks,pst-plot}

\begin{document}
\psset{xunit=1,yunit=0.2}
\begin{pspicture}(-1.75,-12)(7,17) 
\psaxes[ticks=y,Dx=2,Dy=10]{->}(0,0)(-1.7,-12)(5.9,13)[$t(s)$,0][$x$,90]
\psxTick(0){0}
\psline[linecolor=blue](-1,0)(0,0)(0,10)(2,10)(2,-10)(4,-10)(4,0)(5,0)
\end{pspicture}
\end{document}

enter image description here

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You can position the x-labels horizontally via the xlabelOffset key:

enter image description here

\documentclass{article}
\usepackage{pst-plot}
\begin{document}
\psset{xunit=1,yunit=0.2}
\begin{pspicture}(-1.75,-12)(7,17) 
  \psaxes[ticks=y,xlabelOffset=-0.2,Dx=2,Dy=10]{->}(0,0)(-1.7,-12)(5.9,13)[$t(s)$,0][$x$,90]
  \psxTick(0){~~~0}
  \psline[linecolor=blue](-1,0)(0,0)(0,10)(2,10)(2,-10)(4,-10)(4,0)(5,0)
\end{pspicture}
\end{document}

In this specific case, with an xunit=1 (1cm) and Dx=2, xlabelOffset amounts to -0.4cm. As such, you can use

  \psxTick(0){\hspace{0.4cm}0}

to provide an equivalent right-shift for the tick at the origin.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.