2

code:

\begin{pspicture}[showgrid=true](-1,-1)(4,4)
\psline{<->}(0,3)(0,0)(4,0)
 \pscustom[linewidth=1.5pt,linestyle=none]{
 \psplot[plotstyle=curve]{.67}{4}{2 x div}
 \gsave
 \psline(4,3)
 \fill[fillstyle=solid,fillcolor=gray]
 \grestore}
\end{pspicture}

enter image description here

1
  • do you want only the two blue lines? And of course, there is anyway no need for save/restore in this case – user2478 Nov 12 '18 at 7:05
2
\documentclass{article}
\usepackage{pst-plot}
\begin{document}

\begin{pspicture}[showgrid](-1,-1)(4,4)
\psline{<->}(0,3)(0,0)(4,0)
\pscustom[,fillstyle=solid,fillcolor=gray,linestyle=none]{%
    \psplot[plotstyle=curve]{.67}{4}{2 x div}
    \psline(4,3)
}
\psline[linecolor=blue,linewidth=1.5pt](0.67,3)(4,3)(4,0.5) 
\end{pspicture} 

\end{document}

enter image description here

0
1
\documentclass[pstricks,border=1cm]{standalone}
\usepackage{pst-plot}

% Best Practices:
% do always enclose the parameters #1, #2, etc with ()
% do always enclose the most outside with ()
% Are you wondering why?
\def\f(#1){(2/(#1))}
\def\x0{(2/3) }% the last whitespace is not trivial!

% infix to postfix operator
\pstVerb{/I2P {AlgParser cvx exec} def}

\begin{document}
\begin{pspicture}[algebraic](-1,-1)(4,4)
\psaxes{<->}(0,0)(-1,-1)(4,3)[$x$,0][$y$,90]
    \pscustom[fillstyle=solid,fillcolor=gray,linestyle=none]{
        \psplot{\x0 I2P}{4}{\f(x)}
        \lineto(4,3)
    }
    \psline[linecolor=blue,linewidth=1.5pt](*4 {\f(x)})(4,3)(*{\x0 I2P} {\f(x)})
\end{pspicture}
\end{document}

enter image description here

Note:

(*{abscissa} {ordinate}) where

  • abscissa must be a constant in Postfix.
  • ordinate must be a function of x in Infix.
0

Your Answer

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