[pstricks] Reading data with raw postscript
Poul Riis
Poul.Riis at skolekom.dk
Sun Mar 30 22:02:11 CEST 2008
How can I read data from a file with raw postscript commands (see
not-working-example below)?
I guess it has something to do with \ but I also tried to replace it with
/.
Yours,
Poul Riis
\documentclass{article}
\usepackage[svgnames,x11names]{xcolor}
\usepackage{pstricks-add}
\usepackage{geometry}
\makeatletter
\def\psReadfile{\pst at object{psReadfile}}
\def\psReadfile at i#1#2{%File name, number of columbs
\begin at SpecialObj
\addto at pscode{
/inputdatafile (#1) (r) file def
%%%%%%%%%%%%%%%%% read data commands, for instance from
http://www.fho-emden.de/~hoffmann/pstutor22112002.pdf
inputdatafile closefile
}%
\end at SpecialObj}
\makeatother
\begin{document}
\psset{unit=1cm}
\begin{pspicture}(-2,-2)(10,10)
\psaxes[ticksize=-3pt 0]{->}(0,0)(-2,-2)(10,10)
\psReadfile{D:\miktex\filereadertest.dat}{2}%File name, number of
columbs
\end{pspicture}\\[1cm]
\end{document}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filereadertest.dat
Type: application/octet-stream
Size: 4916 bytes
Desc: not available
Url : http://tug.org/pipermail/pstricks/attachments/20080330/0dc9fd9a/attachment.obj
More information about the PSTricks
mailing list