[pstricks] what are the limits of pst-plot?
Herbert Voss
Herbert.Voss at alumni.TU-Berlin.DE
Tue Feb 10 15:50:38 CET 2004
Patrick Drechsler wrote:
> Herbert Voss wrote on 10 Feb 2004 07:05:57 MET:
>
>
>>Patrick Drechsler wrote:
>>
>>
>>>I was wondering what the restrictions for pst-plot (using
>>>`\dataplot') are. I just tried a 2-column 400kb ascii dataplot
>>>and it took almost 5 minutes.
>>>Is pst-plot only to be used with small(er) data?
>>
>>no, I plot files with about 5 MegaBytes of data.
>>send an example file with the data base (as private mail).
>
try this one, it reads only every n^th line from the
file, which makes things faster. This is different to
nStep, which reads _all_ data but plots only every
n^th record.
If it works well, I can put the preamble stuff into
pstricks-add.
Herbert
\listfiles
\documentclass{article}
\usepackage{pst-key}
\usepackage{pstricks-add}
\makeatletter
\define at key{psset}{stepLine}{\edef\psk at stepLine{#1}}
\setkeys{psset}{stepLine=0}
%
\newcount\datacnt
\begingroup
\catcode`\,=13
\catcode`\_=13
\gdef\savedata@#1[#2]{%
\xdef\pst at tempg{#2_}%
\endgroup
\let#1\pst at tempg
\global\let\pst at tempg\relax
\ignorespaces}
\gdef\readdata@{%
\advance\datacnt by 1
% \typeout{No: \the\datacnt}
\read1 to \pst at tempa
% \typeout{tempa --> \pst at tempa{}}
\ifnum\datacnt=\psk at stepLine
% \typeout{reached nStep --> \psk at stepLine}
\global\datacnt=0
\expandafter\readdata@@\pst at tempa_\@nil
\fi
\ifeof1\else\expandafter\readdata@\fi}
\gdef\pst@@readfile#1#2\@nil{\addto at pscode{,#1#2}}%
\gdef\readdata@@#1#2\@nil{\xdef\pst at tempg{\pst at tempg,#1#2}}%
\endgroup
\def\readdata{\@ifnextchar[{\readdata at i}{\readdata at i[]}}
\def\readdata[#1]#2#3{%
\psset{#1}
\openin1=#3
\begingroup
\edef\pst at tempg{}%
\ifeof1
\@pstrickserr{Data file `#3' not found.}\@ehpa
\else
\pst at datadelimiters
\catcode`\[=1
\catcode`\]=2
\global\datacnt=0
\readdata@%
\fi
\endgroup
\let#2\pst at tempg
\global\let\pst at tempg\relax
\ignorespaces%
}
\makeatother
%
\begin{document}
\readdata[stepLine=500]{\dataA}{stressrawdata.txt}
\psset{xunit=0.0005cm,yunit=0.5cm}
%
% 20000 ms; 12 kPa
\begin{pspicture}(0,0)(20000,12)
%% ACHTUNG: dauert ewig...!
\psaxes[Dx=5000]{->}(0,0)(20000,12)
\dataplot[plotstyle=dots]{\dataA}
\end{pspicture}
\end{document}
--
http://www.pstricks.de/
More information about the PSTricks
mailing list