以下代码取自从这个答案
\documentclass[border=0bp]{standalone}
\usepackage{pst-plot}
\begin{document}
\psset{unit=1.5cm}
\begin{pspicture}[showgrid=false](-2.75,-0.75)(4,2)
\psframe*[linecolor=yellow,opacity=0.5](-2.75,-0.75)(4,2)
\psaxes[linecolor=lightgray]{->}(0,0)(-2.5,-0.5)(3.5,1.5)[$t$,0][$F(t)$,90]
\psset{algebraic,linewidth=1.5pt,linecolor=red}
\pscustom
{
\psplot{-2.5}{-1}{0}
\psplot{-1}{0}{(x+1)/4}
\psplot{0}{1}{1/2}
\psplot{1}{2}{(x+7)/12}
\psplot{2}{3.5}{1}
}
\end{pspicture}
\end{document}
我想知道如何隐藏 x 和 y 轴上的数字和小垂直线?我只想要带箭头的线。
答案1
您应该将选项ticks
和添加labels
到\psaxes
宏中。选项可以采用不同的键,例如all
、none
和。例如,使用将隐藏所有刻度和所有标签。使用将仅在 y 轴上显示刻度和标签。有关此类选项的x
更多信息,我建议查看y
ticks=none, labels=none
ticks=y, labels=y
手动的。
\documentclass[border=10mm,pstricks]{standalone}
\usepackage{pst-plot}
\begin{document}
\psset{unit=1.5cm}
\begin{pspicture}[showgrid=false](-2.75,-0.75)(4,2)
\psframe*[linecolor=yellow,opacity=0.5](-2.75,-0.75)(4,2)
\psaxes[linecolor=lightgray,ticks=none,labels=none]{->}(0,0)(-2.5,-0.5)(3.5,1.5)[$t$,0][$F(t)$,90]
\psset{algebraic,linewidth=1.5pt,linecolor=red}
\pscustom
{
\psplot{-2.5}{-1}{0}
\psplot{-1}{0}{(x+1)/4}
\psplot{0}{1}{1/2}
\psplot{1}{2}{(x+7)/12}
\psplot{2}{3.5}{1}
}
\end{pspicture}
\begin{pspicture}[showgrid=false](-2.75,-0.75)(4,2)
\psframe*[linecolor=yellow,opacity=0.5](-2.75,-0.75)(4,2)
\psaxes[linecolor=lightgray,ticks=x,labels=x]{->}(0,0)(-2.5,-0.5)(3.5,1.5)[$t$,0][$F(t)$,90]
\psset{algebraic,linewidth=1.5pt,linecolor=red}
\pscustom
{
\psplot{-2.5}{-1}{0}
\psplot{-1}{0}{(x+1)/4}
\psplot{0}{1}{1/2}
\psplot{1}{2}{(x+7)/12}
\psplot{2}{3.5}{1}
}
\end{pspicture}
\begin{pspicture}[showgrid=false](-2.75,-0.75)(4,2)
\psframe*[linecolor=yellow,opacity=0.5](-2.75,-0.75)(4,2)
\psaxes[linecolor=lightgray,ticks=y,labels=y]{->}(0,0)(-2.5,-0.5)(3.5,1.5)[$t$,0][$F(t)$,90]
\psset{algebraic,linewidth=1.5pt,linecolor=red}
\pscustom
{
\psplot{-2.5}{-1}{0}
\psplot{-1}{0}{(x+1)/4}
\psplot{0}{1}{1/2}
\psplot{1}{2}{(x+7)/12}
\psplot{2}{3.5}{1}
}
\end{pspicture}
\end{document}