请考虑以下示例:
\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}
网格中的垂直线没有显示。我确信这是因为我选择了错误的开始和结束参数(10
和19
),但我不知道正确的参数是什么;任何有关这个简单问题的帮助都将不胜感激。
答案1
将代码移动xticksize
到构建 x 轴的位置:
\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}