3

Consider the following example.

Code

% latex test.tex
% dvips test.dvi
% ps2pdf test.ps

\documentclass{article}

\usepackage{pst-coil,pstricks-add}

\def\turister#1#2{%
 \psset{linewidth=0.075,linecolor=red}
  \psline(!#1 1990 sub 0)(!#1 1990 sub #2 190 sub)
  \psline(!#1 1990 sub 0.25 sub #2 190 sub)(!#1 1990 sub 0.25 add #2 190 sub)
}

\begin{document}

\psset{xunit=1.4,yunit=0.07}
\begin{pspicture}(8,150)
  \psaxes[labels=none,yAxis=false](1,0)
  \psaxes[Ox=1991,yAxis=false]{->}(1,0)(6.5,0)[{\AA}rstal,0][,90]
  \psaxes[xAxis=false,Oy=200,Dy=10](0,2)
  \pszigzag[coilarm=0.125,coilwidth=0.3,coilheight=0.5](0,2)(0,8)
  \psaxes[xAxis=false,Oy=200,Dy=10,ylabelFactor={\cdot 10^3}]{->}%
    (0,10)(0,7.5)(0,135)[,0][Antal norske turister,90]
  \psline[linecolor=blue](0,98)(6.5,98)
  \turister{1991}{264}
  \turister{1992}{285}
  \turister{1993}{290}
  \turister{1994}{298}
  \turister{1995}{275}
  \turister{1996}{316}
\end{pspicture}

\end{document}

Output

output

Question

What is the easiest way to get the same labels on the x-asix as now?

I guess writing

\psaxes[labels=none,yAxis=false](1,0)
\psaxes[Ox=1991,yAxis=false]{->}(1,0)(6.5,0)[{\AA}rstal,0][,90]

is overkill, but my attempts to get it with a single \psaxes have failed.

3
  [...]
  \psaxes[Oy=190,Dy=10,ylabelFactor={\cdot 10^3},Ox=1990,showorigin=false]{->}%
    (0,0)(6.5,130)[,0][Antal norske turister,90]
  \psline[linecolor=white](0,10)
  \pszigzag[coilarm=0.25,coilwidth=0.3,coilheight=0.5](0,0)(0,10)
  [...]
| improve this answer | |
  • You got mail ;-) – Marco Daniel May 20 '13 at 14:33
  • This is almost perfect: There is a very thin, non-white frame around the line from (0,0) to (0,10). How do I remove this frame? – Svend Tveskæg May 20 '13 at 15:09
  • Arrrh! It is a PDF viewer problem; when using Adobe Reader everything is fine. – Svend Tveskæg May 20 '13 at 15:12
  • 1
    @PredragPunosevac Evince on Fedora. – Svend Tveskæg May 20 '13 at 16:19
  • 1
    @PredragPunosevac: it is often a problem of the current magnification not the viewer – user2478 May 20 '13 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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