2

Consider the following example:

\documentclass{article}

\usepackage{pst-coil,pst-plot}

\begin{document}

\begin{figure}
 \centering
 \psset{unit=0.6}
  \begin{pspicture}(-2.0,-0.7)(18.2,11.2)
    % x-axis.
    \psaxes[
      yAxis=false,
      xLabels={1997,,,2000,,,,,2005,,,,,2010}
    ]{->}(1,0)(0,0)(15.5,0)[Something,0][,90]
    % y-axis.
    \psaxes[
      xAxis=false
    ](0,0.25)
    \psyTick(0){0}
    \pszigzag[
      coilarm=0.0625,
      coilwidth=0.3,
      coilheight=0.5
    ](0,0.25)(0,0.75)
    \psaxes[
      xAxis=false,
      Oy=10,
      dy=1,
      Dy=2,
      ylabelFactor={\cdot 10^6},
      ticklinestyle=dotted,
      tickwidth=0.5pt,
      xticksize=10 19, % Wrong!
      yticksize=0 15
    ]{->}(0,1)(0,0.75)(0,10.5)[,0][Something else,90]
    \psline[
      linecolor=blue
    ](1,4.55)(2,4.55)(2,4.9)(3,4.9)(3,5.95)(4,5.95)(4,7.35)(6,7.35)(6,8.6)(9,8.6)(9,10)(10,10)
    \rput*(4.5,9){\shortstack[l]{%
      \footnotesize{Antal}\strut\\[-0.5ex]
      \footnotesize{passagerer,}\strut\\[-0.5ex]
      \footnotesize{lufthavnen}\strut\\[-0.5ex]
      \footnotesize{kan betjene}\strut
    }}
    \psline[
      linecolor=red
    ](1,4.3)(2,4.7)(3,5.1)(4,5.5)(5,6)(6,6.45)(7,7)(8,7.55)(9,8.1)(15,9.6)
    \rput*(9,6){\shortstack[l]{%
      \footnotesize{Forventet}\strut\\[-0.5ex]
      \footnotesize{passagertal}\strut
    }}
  \end{pspicture}
\end{figure}

\end{document}

output

The vertical lines in the grid are not showing. I am rather sure it is because I have chosen the wrong beginning and end parameters (10 and 19) but I have no idea what the correct ones are; any help on this simple question will be much appreciated.

2

Move the code for xticksize to where you build the x axis:

\documentclass{article}

\usepackage{pst-coil,pst-plot}

\begin{document}

\begin{figure}
 \centering
 \psset{unit=0.6}
  \begin{pspicture}(-2.0,-0.7)(18.2,11.2)
    % x-axis.
    \psaxes[
      yAxis=false,
      xLabels={1997,,,2000,,,,,2005,,,,,2010},
      ticklinestyle=dotted,
      tickwidth=0.5pt,
      xticksize=0 10,
    ]{->}(1,0)(0,0)(15.5,0)[Something,0][,90]
    % y-axis.
    \psaxes[
      xAxis=false
    ](0,0.25)
    \psyTick(0){0}
    \pszigzag[
      coilarm=0.0625,
      coilwidth=0.3,
      coilheight=0.5
    ](0,0.25)(0,0.75)
    \psaxes[
      xAxis=false,
      Oy=10,
      dy=1,
      Dy=2,
      ylabelFactor={\cdot 10^6},
      ticklinestyle=dotted,
      tickwidth=0.5pt,
      yticksize=0 15
    ]{->}(0,1)(0,0.75)(0,10.5)[,0][Something else,90]
    \psline[
      linecolor=blue
    ](1,4.55)(2,4.55)(2,4.9)(3,4.9)(3,5.95)(4,5.95)(4,7.35)(6,7.35)(6,8.6)(9,8.6)(9,10)(10,10)
    \rput*(4.5,9){\shortstack[l]{%
      \footnotesize{Antal}\strut\\[-0.5ex]
      \footnotesize{passagerer,}\strut\\[-0.5ex]
      \footnotesize{lufthavnen}\strut\\[-0.5ex]
      \footnotesize{kan betjene}\strut
    }}
    \psline[
      linecolor=red
    ](1,4.3)(2,4.7)(3,5.1)(4,5.5)(5,6)(6,6.45)(7,7)(8,7.55)(9,8.1)(15,9.6)
    \rput*(9,6){\shortstack[l]{%
      \footnotesize{Forventet}\strut\\[-0.5ex]
      \footnotesize{passagertal}\strut
    }}
  \end{pspicture}
\end{figure}

\end{document}

enter image description here

|improve this answer|||||
  • @SvendTveskæg You're welcome! – Gonzalo Medina Sep 2 '13 at 3:52

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.