[pstricks] Scaling, \psaxes, and \psplot

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Mon Mar 14 21:39:36 CET 2005


rossi at york.cuny.edu wrote:

>The file enclosed below plots the Maxwell-Boltzmann velocity probability
>distribution for a sample of gas at 300 K and molar mass 40 g/mol.
>
>But the y-axis scale is too small.  
>
>I always approached scaling for \psplot/\psaxes by the following recipe:
>
>(value for yunit) x (actual value of y in the function) = size of graph in cm
>
>But the probability distribution (i.e. the y-axis) is very small, and so yunit
>is as large as it can be, i.e. 500 cm.  And the graph of the distribution shown
>on the y-axis is very shallow.  I want it to look like a large camel's hump.
>
>This can't be right. I shouldn't be using such a large value for yunit.
>
>\psset{yunit=500cm}
>
>What am I doing wrong?  How do I plot functions that have very small values and
>yet get graphs that look reasonable?
>  
>
a problem with very large/small units. It is easier to do scaling
on PostScript side

Herbert


\documentclass[12pt,a4paper]{article}
\listfiles
\usepackage{pst-plot}
\usepackage{pstricks-add}
                                                                                

                                                             
\begin{document}

\begin{pspicture}(0,0)(10,5)
  \psaxes[Dx=100,dx=1,Dy=0.00075,dy=1]{->}(0,0)(11,5)
  \pstVerb{%
    /e 2.718282 def
    /const1  3.30 10 8 neg exp mul def
    /s 10 1 exp def
    /const2  6.04 10 6 neg exp mul def
  }
  \psplot[linecolor=red, plotstyle=curve,%
     linewidth=2pt, plotpoints=200]{0}{11}{%
     const1
     x 100 mul dup mul mul e const2 neg
     x 100 mul dup mul mul exp mul 2000 mul}
\end{pspicture}
                                                                                

\end{document}

-- 
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes





More information about the PSTricks mailing list