[pstricks] draw the bell-shaped

Arnaud Schmittbuhl aschmittbuhl at libertysurf.fr
Mon Mar 12 16:54:08 CET 2007


Le Mon, 12 Mar 2007 20:52:15 +0700,
"Vo Duc Hoang Vu" <vu at vnp.edu.vn> a écrit :

> Could you help me using pstricks to draw a bell-shaped curve with
> filling two tails as the picture below?
> http://img221.imageshack.us/img221/3385/hamsoxacsuatfm3.jpg


\listfiles
\documentclass{article}
\usepackage{pstricks-add}
\begin{document}

\begin{pspicture}(-4,0)(4,4)
\psset{xunit=2,unit=2.5}
%% Drawing under curve (right)
\psclip{%
  \pscustom{\psplot{1.5}{3}{2.17828 x dup mul neg exp 2 mul}
          \lineto(1.5,0)}}
\psframe*[linecolor=red](0,0)(4,4)
\endpsclip
%% Drawing under curve (left)
\psclip{%
  \pscustom{\psplot{-3}{-1.5}{2.17828 x dup mul neg exp 2 mul}
            \lineto(-1.5,0)}}
\psframe*[linecolor=red](0,0)(-4,4)
\endpsclip
%% Drawing blue axes, no numbers but tics
\def\psvlabel#1{} \def\pshlabel#1{}
\psaxes[linecolor=blue,linewidth=0.025]
       {->}(0,0)(-3.5,0)(3.5,2.5)
\uput[90](3.5,0){\Large$x$} \uput[0](0,2.5){\Large$y$}
%% Drawing brown curve
\psplot[linecolor=brown,linewidth=0.025]
       {-3}{3}{2.17828 x dup mul neg exp 2 mul}
\end{pspicture}
\end{document}


 *File List*
 article.cls    2004/02/16 v1.4f Standard LaTeX document class
  size10.clo    2004/02/16 v1.4f Standard LaTeX file (size option)
pstricks-add.sty    2005/03/03 package wrapper for pstricks-add.tex (hv)
pstricks.sty    2006/08/10 v0.32 LaTeX wrapper for `PSTricks' (RN,HV)
pstricks.tex    2006/12/22 v1.15 `PSTricks' (tvz)
pstricks.pro
  xcolor.sty    2005/12/21 v2.09 LaTeX color extensions (UK)
   color.cfg    2001/08/31 v1.1 color configuration of teTeX/TeXLive
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pstricks-add.tex    2007/01/22 v2.83 `PSTricks-add' (hv)
pst-xkey.tex    2005/02/22 v1.5 PSTricks specialization of xkeyval (HA)
 xkeyval.sty    2005/11/25 v2.5e package option processing (HA)
 xkeyval.tex    2005/08/12 v2.5d key=value parser (HA)
pstricks-add.pro

-- 
Arnaud Schmittbuhl
Montpellier, France





More information about the PSTricks mailing list