0

The following code taken from this answer

\documentclass[border=0bp]{standalone}

\usepackage{pst-plot}

\begin{document}

\psset{unit=1.5cm} \begin{pspicture}showgrid=false(4,2) \psframe*linecolor=yellow,opacity=0.5(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}

I wonder how to hide the numbers and the small verticle line from x any y axes? I only want lines with arrows.

No One
  • 269
  • 1
    Add ticks=none, labels=none as options to the \psaxes macro. – Jasper Habicht Sep 30 '22 at 01:14
  • @JasperHabicht Thanks! How do I hide them just for x-axis or y-axis alone? If this is complicated, I will add my question body to ask it more formally. – No One Sep 30 '22 at 01:35
  • I would not say that it is overly complicated .... If you only want ticks and labels on the y axis, add ticks=y, labels=y, if you only want ticks and labels on the x axis, add ticks=x, labels=x. Maybe have a look at the manual – Jasper Habicht Sep 30 '22 at 06:26

1 Answers1

1

You should add the options ticks and labels to the \psaxes macro. The options can take different keys, such as all, none, x and y. Using, for example ticks=none, labels=none would hide all ticks and all labels. Using ticks=y, labels=y would show ticks and labels only on the y axis. For more information about such options, I'd suggest to have a look in the manual.

\documentclass[border=10mm,pstricks]{standalone}
\usepackage{pst-plot}

\begin{document}

\psset{unit=1.5cm} \begin{pspicture}showgrid=false(4,2) \psframe*linecolor=yellow,opacity=0.5(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(4,2) \psframe*linecolor=yellow,opacity=0.5(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(4,2) \psframe*linecolor=yellow,opacity=0.5(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}

enter image description here