# [pstricks] shading area under a curve

Fri Apr 6 23:36:50 CEST 2007

Herbert,

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).

Thanks,
Derek

Herbert Voss wrote:
> Derek Collis schrieb:
>
>> Herbert,
>>
>> I do subscribe to the list and I have your 3 and 4 Ed of PSTricks;
>> however, neither have helped me. All the examples that I've seen, and
>> the one you suggested, do not answer my question.
>>
>> I want to sketch y=x^2 over, say, -3 to 3, however, I only want the
>> region between x=1 and x=2 under the parabola shaded.
>>
>
> \documentclass{article}
> \usepackage{pst-plot}
> \pagestyle{empty}
> \begin{document}
>
> \begin{center}
>   \begin{displaymath}
>     f(x)=x^2
>   \end{displaymath}
>
>   \begin{pspicture}(-3.5,-.5)(3.5,9.5)
>     \psplot{-3}{3}{x x mul}
>     \pscustom[fillstyle=solid,fillcolor=cyan]{%
>       \psline(1,0)(1,1)
>       \psplot{1}{2}{x x mul}
>       \psline(2,4)(2,0)}
>     \psaxes{->}(0,0)(-3.5,0)(3.5,9)
>   \end{pspicture}
> \end{center}
>
> \end{document}
>
>
> Herbert
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>
>