<div><font face="Arial" size="2"><span class="244100717-14042009">Please help me. I've modified one of the macro examples from the Latex Graphics Companion (See below). My objective was to specify the relative error in the measurements via passing to the macro rather than from the file. This is for singular measurements where the equipment error is estimated a priori. Also I wanted to be able to plot data files in the form (x y1 y2 y3 ... yn) much like the pstricks-add listplot function.</span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009"></span></font> </div>
<div><font face="Arial" size="2"><span class="244100717-14042009">The code actually works for simply formatted data files example:</span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009">1 2 3 4 </span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009">2 3 4 5</span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009">3 4 5 6 </span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009">4 5 6 7</span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009"></span></font> </div>
<div><font face="Arial" size="2"><span class="244100717-14042009">Will plot fine with GetCoordinates{\dataA}{relxerr}{relyerr}{plotno}{totalcol}. However my data files are formatted as such:</span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009">1.00E+001 2.00E+001 3.00E+001 4.00E+001</span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009"><span class="244100717-14042009">2.00E+001 3.00E+001 4.00E+001 5.00E+001</span></span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009"><span class="244100717-14042009"><span class="244100717-14042009">3.00E+001 4.00E+001 5.00E+001 6.00E+001</span></span></span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009"><span class="244100717-14042009"><span class="244100717-14042009"><span class="244100717-14042009">4.00E+001 5.00E+001 6.00E+001 7.00E+001</span></span></span></span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009"><span class="244100717-14042009"><span class="244100717-14042009"><span class="244100717-14042009"></span></span></span></span></font> </div>
<div><font face="Arial" size="2"><span class="244100717-14042009"><span class="244100717-14042009"><span class="244100717-14042009"><span class="244100717-14042009">Listplot will handle this data file just fine but my macro gives a number error on the character "E". Now I assume I can do a conversion (text to number) of the number at the <a href="mailto:GetCoordinates@ii">GetCoordinates@ii</a> level, but I don't know how. </span></span></span></span></font><font face="Arial" size="2"><span class="244100717-14042009">I am no Tex/Latex/Postscript expert so my code may not be pretty. An suggestions for improvement would be appreciated.</span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009"></span></font> </div>
<div><font face="Arial" size="2"><span class="244100717-14042009">Thanks,</span></font></div>
<div><font face="Arial" size="2"><span class="244100717-14042009"></span></font> </div>
<div><font face="Arial" size="2"><span class="244100717-14042009">Buddy Ledger</span></font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">\documentclass[]{article}</font></div>
<div> </div>
<div><font face="Arial" size="2"> \usepackage{pst-all}<br> \usepackage{pst-func}<br> \usepackage{pst-eucl}<br> \usepackage{pst-stru}<br> \usepackage{pst-ob3d}<br> \usepackage{pst-3dplot}<br>
\usepackage{pst-vue3d}<br> \usepackage{pstricks-add}<br> \usepackage{graphicx}<br> \usepackage{ifthen}</font></div>
<div> </div>
<div><font face="Arial" size="2">\makeatletter</font></div>
<div> </div>
<div><font face="Arial" size="2">%\SpecialCoor<br>\def\pserrorLine{\pst@object{pserrorLine}}<br>\def\pserrorLine@i(#1)#2#3{\begingroup<br> \use@par \pst@getcoor{#1}\pst@tempA<br> \def\ps@xErr{#2}\def\ps@yErr{#3}%<br> \psline{|-|}(! /yDot \pst@tempA exch pop \pst@number\psyunit div def<br>
/xDot \pst@tempA pop \pst@number\psxunit div def<br> xDot yDot yDot \ps@yErr\space mul add )<br> (! /yDot \pst@tempA exch pop \pst@number\psyunit div def<br> /xDot \pst@tempA pop \pst@number\psxunit div def<br>
xDot yDot yDot \ps@yErr\space mul sub )<br> \psline{|-|}(! /yDot \pst@tempA exch pop \pst@number\psyunit div def<br> /xDot \pst@tempA pop \pst@number\psxunit div def<br> xDot xDot \ps@xErr\space mul add yDot )<br>
(! /yDot \pst@tempA exch pop \pst@number\psyunit div def<br> /xDot \pst@tempA pop \pst@number\psxunit div def<br> xDot xDot \ps@xErr\space mul sub yDot )<br>\endgroup}</font></div>
<div> </div>
<div><font face="Arial" size="2">\def\GetCoordinates#1#2#3#4#5{%<br>\def\relxerr{#2}<br>\def\relyerr{#3}<br>\def\numplot{#4}<br>\def\numplotmax{#5}<br>\newcounter{loopcount}<br>\expandafter\GetCoordinates@i#1}</font></div>
<div> </div>
<div><font face="Arial" size="2">\def\GetCoordinates@i#1{\GetCoordinates@ii#1}<br>\def\GetCoordinates@ii D #1 {%<br> \addtocounter{loopcount}{1}<br> \ifthenelse{\value{loopcount}=1}{\def\plotxval{#1}}{%<br> \ifthenelse{\value{loopcount}=\numplot}{\def\plotyval{#1}}{%<br>
\ifthenelse{\value{loopcount}=\numplotmax}{%<br> \psdot(\plotxval,\plotyval)<br> \pserrorLine(\plotxval,\plotyval){\relxerr}{\relyerr}%<br> \setcounter{loopcount}{0}}{}}}<br> \@ifnextchar D{\GetCoordinates@ii}{}}</font></div>
<div> </div>
<div><font face="Arial" size="2">\makeatother</font></div>
<div> </div>
<div><font face="Arial" size="2">\begin{document}<br>\pagestyle{empty}<br>\pagenumbering{arabic}</font></div>
<div> </div>
<div><font face="Arial" size="2">\psset{xAxisLabel=Centerline Velocity[m/s],<br> yAxisLabel=Vibration Amplitude [\%Dia],<br> xAxisLabelPos={c,-0.5in},<br> yAxisLabelPos={-0.5in,c},<br> lly=-0.55in,llx=-0.55in,ury=0.25in,urx=0.15in}</font></div>
<div> </div>
<div><font face="Arial" size="2">\readdata[ignoreLines=0]{\dataA}{data/doterrorbar.dat}</font></div>
<div> </div>
<div><font face="Arial" size="2">\begin{figure}<br>\centering<br>\begin{psgraph}[Dx=5,Dy=5,xsubticks=0,ysubticks=0](0,0)(0,0)(40,40){5.3in}{5.3in}</font></div>
<div> </div>
<div><font face="Arial" size="2">\GetCoordinates{\dataA}{0.01}{0.1}{2}{4}</font></div>
<div> </div>
<div><font face="Arial" size="2">\end{psgraph}<br>\caption{Error Bars.}<br>\end{figure}</font></div>
<div> </div>
<div><font face="Arial" size="2">\end{document}</font></div>
<div> </div>
<div><font face="Arial" size="2"></font> </div>