[pstricks] shading area under a curve
Herbert Voss
LaTeX at zedat.fu-berlin.de
Fri Apr 6 23:50:59 CEST 2007
Derek Collis schrieb:
> This is good, now can I ask one more question: How can I graph say,
> y=log x, and shade the region between x=3 and x=4, but without
> evaluating log 3 and log 4 to give the y-coordinates of the lines x=3
> and x=4. Is there a way to graph the boundary lines of the shaded region
> from (3,0) to (3, the point on log x) and (4,0) to (4, the point on log x).
>
use \SpecialCoor
\documentclass{article}
\usepackage{pst-plot}
\SpecialCoor
\pagestyle{empty}
\begin{document}
\psset{yunit=2}
\begin{pspicture}(-.5,-2)(5,1)
\psplot[linewidth=1pt,linecolor=blue]{0.01}{5}{x log}
\pscustom[fillstyle=solid,fillcolor=cyan,linestyle=none]{%
\psline(3,0)(!3 dup log)
\psplot{3}{4}{x log}
\psline(!4 dup log)(4,0)}
\psaxes{->}(0,0)(-.5,-2)(5,1)
\end{pspicture}
\end{document}
Herbert
More information about the PSTricks
mailing list