Graphics, Figures & Tablesdrawing normal density with pstricks

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
bobbylou
Posts: 18
Joined: Tue Apr 21, 2009 6:54 pm

drawing normal density with pstricks

Post by bobbylou »

Hi,

I am trying to draw a graph of the normal density with mean 100 and standard deviation 10. I'd like it to be a "normal" size. I can't seem to figure out how to get the axes labeled for this mean. I think I'd like axes in the shape of an upside-down T (ie showing only the first and second quadrants of a Cartesian graph) with the origin at (100,0). I'll attach the closest thing I have to what I want -- basically, this is the right size and shape, etc, but I just want the axes labeled as explained above. I've been fiddling around with the various parameters for a while now and can't seem to get it. Thanks so much!

Code: Select all

\begin{pspicture}(-6,-1)(6,6)
\psset{yunit=4,xunit=2}
\psaxes{->}(-2.5,0)(2.5,1.25)
\psGauss[linecolor=red,linewidth=1pt]{-2}{2}
\end{pspicture}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

drawing normal density with pstricks

Post by localghost »

Please get used to posting complete examples instead of useless code snippets.

Code: Select all

\documentclass{minimal}
\usepackage{pst-func,pstricks-add}

\begin{document}
  \begin{pspicture}[showgrid=false](-6,-1)(6,6)
    \psset{xunit=2,yunit=4}
    \psaxes{->}(0,0)(-2.5,0)(2.5,1.25)
    \psGauss[linecolor=red,linewidth=1pt]{-2}{2}
  \end{pspicture}
\end{document}
The first pair of coordinates for the axes represents the origin. See the pstricks(-add) manual for more details. A similar solution is available from another topic [1].

[1] View topic: using pstricks


Best regards
Thorsten
Post Reply