2

I would like to fill the area under a Bezier curve and a line with color in PSTricks. How can I do that?

Here is what I tried so far:

\begin{pspicture}(20,25)(160,80)
\psline[linewidth=0.55]{|->}(20,30)(160,30)
\psbezier(90,30)(90,30)(90,30)(90,30)
\rput(90,25){$\rho_i^A$}
\psbezier(125,30)(125,30)(125,30)(125,30)
\psbezier(55,30)(55,30)(55,30)(55,30)
\rput(55,25){$\rho_0$}
\rput(125,25){$p_HR$}
\psline[linestyle=dotted](90,80)(90,25)
\psline[linestyle=dotted](125,80)(125,25)
\psline[linestyle=dotted](55,80)(55,25)
\rput(160,25){$\rho_i$}
\psline(20,50)(55,50)
\psline(125,70)(160,70)
\pscustom[]{\psbezier(55,50)(65.5,50)(73,51.5)(80,55)
\psbezier(87,58.5)(90,60)(90,60)
}
\psbezier(90,60)(100.5,67)(111,70)(125,70)
\rput(20,25){$0$}
\end{pspicture}

enter image description here By the way, I created the code by using jPicEdt.

2
\documentclass{article}
\usepackage{pstricks}
\usepackage{xcolor}
\begin{document}

\psset{unit=1mm}
\begin{pspicture}(20,25)(160,80)
\psline[linewidth=0.55]{|->}(20,30)(160,30)
\rput(90,25){$\rho_i^A$}
\rput(55,25){$\rho_0$}
\rput(125,25){$p_HR$}
\psline[linestyle=dotted](90,80)(90,25)
\psline[linestyle=dotted](125,80)(125,25)
\psline[linestyle=dotted](55,80)(55,25)
\rput(160,25){$\rho_i$}
\pscustom[fillstyle=solid,fillcolor=blue!60,opacity=0.5,linestyle=none]{%
    \psline(20,30)(20,50)(55,50)
    \psbezier(65.5,50)(73,51.5)(80,55)
    \psbezier(87,58.5)(90,60)(90,60)
    \psbezier(100.5,67)(111,70)(125,70)
    \psline(160,70)(160,30)
}
\psset{linecolor=blue,linewidth=1.5pt}
\psline(20,50)(55,50)
\psbezier(55,50)(65.5,50)(73,51.5)(80,55)
\psbezier(80,55)(87,58.5)(90,60)(90,60)
\psbezier(90,60)(100.5,67)(111,70)(125,70)
\psline(125,70)(160,70)
\rput(20,25){$0$}
\end{pspicture}

\end{document}

enter image description here

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.