ich möchte gerne verschiedene Spalten einer Quelldatei gegeneinander auftragen, z.B. zweite und dritte Spalte über die erste (siehe Anhang).
Jetzt habe ich in der PSTricks Documentation folgendes Beispiel gefunden:
\def\PstDataFileWithErrorBars{% 2 \def\pst@par{}\pst@object{PstDataFileWithErrorBars}} 3 4 \def\PstDataFileWithErrorBars@i#1{% 5 \begingroup 6 \use@par% Assignment of local parameters 7 % Read the data from the file and put them in a macro 8 \readdata{\PstDataFileWithErrorBars@Data}{#1}% 9 \PstDataFileWithErrorBars@GetCoordinate{% 10 \PstDataFileWithErrorBars@Data}} 11 12 \def\PstDataFileWithErrorBars@GetCoordinate#1{% 13 \expandafter\PstDataFileWithErrorBars@GetCoordinate@i#1 } 14 15 \def\PstDataFileWithErrorBars@GetCoordinate@i#1{% 16 \PstDataFileWithErrorBars@GetCoordinate@ii#1} 17 18 \def\PstDataFileWithErrorBars@GetCoordinate@ii% 19 #1 #2 #3 #4 #5 #6 #7 #8 {% 20 \PstDataFileWithErrorBars@DoCoordinate(#2,#4){#6}{#8}% 21 \@ifnextchar D{\PstDataFileWithErrorBars@GetCoordinate@ii}% 22 {\endgroup}} 23 24 \let\PstDataFileWithErrorBars@DoCoordinate 25 \PstDataWithErrorBars@DoCoordinate 26 27 \psset{dotscale=1.5}% 28 29 \pspicture(5,5)\psgrid[subgriddiv=0] 30 \PstDataFileWithErrorBars[dotstyle=diamond]{err-bars.dat} 31 \endpspicture 32 \hfill 33 % 34 \newpsstyle{MyStyleBars}{linecolor=cyan,arrows=(-),arrowscale=1.5} Writing high-level macros: Usage 180 35 \psset{xunit=0.8,yunit=0.5} 36 \pspicture(5,5)\psgrid[subgriddiv=0] 37 \PstDataFileWithErrorBars[StyleBars=MyStyleBars]{err-bars.dat} 38 \endpspicture
Jetzt ist das leider wieder Overkill für mich und ich versuche stückweise diesen Macro für meine Bedürfnisse umzuschreiben und habe zaghaft begonnen:
% % mehrere-spalten.tex % \usepackage{scrreprt} \usepackage{pstricks} \usepackage{pstricks-add} \usepackage{pst-plot} \def\PstDataFileWithMultipleColumns{% \def\pst@par{}\pst@object{PstDataFileWithMultipleColumns}} \def\PstDataFileWithMultipleColumns@i#1{% \begingroup \use@par% \readdata{\PstDataFileWithMultipleColumns@Data}{#1}% \PstDataFileWithMultipleColumns@GetCoordinate{% \PstDataFileWithMultipleColumns@Data}} \begin{document} hello World \end{document} % % EoF %
\def\PstDataFileWithMultipleColumns@i#1{%
Ist das eine Art for-Schleife mit dem Index i?
Viele Grüße,
Klaus.