[pstricks] psPrintValue
Poul Riis
Poul.Riis at skolekom.dk
Wed Mar 5 20:24:15 CET 2008
I'd better correct some stupid errors in the example....
Yours,
Poul Riis
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{helvet,mathptmx}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[danish]{babel}
\usepackage[svgnames,x11names]{xcolor}
\usepackage{pst-func}
\usepackage{pstricks-add}
\begin{document}
\begin{center}
\psset{xunit=4cm,yunit=10cm}
\begin{pspicture}(-1.85,0)(1.85,1.05)
\psaxes[ticksize=-3pt 0,Dx=0.2,Dy=0.1]{->}(0,0)(-1.85,0)(1.85,1.05)
\pstVerb{/pi 3.14159265 def /aa 0.0025 def /lambda 0.00006328 def /kk pi
aa mul lambda div def /LL 50 def}%%%% Everything in cm
\psplot[linecolor=red,plotpoints=200]{-1.8}{1.8}{x dup mul LL dup mul add
sqrt x exch div kk mul /alpha exch def alpha pi div 180 mul sin alpha div
dup mul x LL div dup mul 1 add div}
\uput{0pt}[0](1.0,0.95){$\lambda=$\psPrintValue{lambda 10000 mul 1000
mul}\hspace{2.5em}nm}
\uput{0pt}[0](1.0,0.90){$a=$\psPrintValue{aa 10 mul}\hspace{2.5em}mm}
\uput{0pt}[0](1.0,0.85){$L=$\psPrintValue{LL}\hspace{1.2em}cm}
\uput{7pt}[90](1.7,0){$x$ /cm}
\uput{9mm}[180]{90}(0,0.85){Intensity (arbitrary units)}
\end{pspicture}
\end{center}
\end{document}
More information about the PSTricks
mailing list