[pstricks] Rendering modified arguments inside a macro (Jorge Nto)

Jorge Nto jorgento at gmail.com
Mon Dec 14 11:50:03 CET 2009

>sure, the syntax of \rput is

>Only x,y can be an calculated expression when a preceeding ! is
>detected. What do you want to do with the rput.
>Please provide a _full_ minimal example.


I just want to display the result of numerical calculations at the given
coordinates. Well, I have just seen that multiplication works.
So if I put  \rput(#2,#4){Radius: #6\pst at number\psyunit}% the argument #6 is
multiplied by yunit, but I don't know how to express the other operations
(addition, division, etc)
See (working) example below. What if I need the addition of #6 and
\pst at number\psyunit instead of multiplication:


 0, 20, 25
 100, 150, 23
230, 20, 30
300, 100, 50
450, 50, 25


 \newcommand{\g}{! 10.0 6 mul}%
\def\psPrintfLikePlot{\pst at object{psPrintfLikePlot}}
\def\psPrintfLikePlot at i#1{\begin at SpecialObj\expandafter\psPrintfLikePlot at ii
\def\psPrintfLikePlot at ii #1{\psPrintfLikePlot at iii#1}
\def\psPrintfLikePlot at iii#1 #2 #3 #4 #5 #6 {%
 \pscircle(#2,#4){! #6 0.02 mul }%
 \rput(#2,#4){Radius: #6\pst at number\psyunit}%
   \@ifnextchar D{\psPrintfLikePlot at iii}{\end at SpecialObj}}

\psset{xunit=0.02, yunit=0.02}% wirkt auch auf pspicture
\begin{pspicture}(-50, -150)(550,150)  %also 6 x 3 cm %%%%%%
\psgrid[unit=1cm,subgriddiv=0,griddots=10,gridlabels=0pt, gridwidth=0.3pt]
\psaxes[linewidth=0.7pt,  Dx=100, Dy=100,%
%\listplot[plotstyle=dots, linecolor=blue]{\data}



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20091214/613de294/attachment.html>

More information about the PSTricks mailing list