# [pstricks] TeX loop structures versus Postscript Loop Structures and Plotting

Herbert Voss Herbert.Voss at FU-Berlin.DE
Fri May 1 20:51:53 CEST 2009

```Buddy Ledger schrieb:

> I have been working on developing a few plotting routines for writing a
> thesis.  I started out using high level TeX objects only, i.e. repeated
> \psdot or \psline calls using a TeX loop (adapted from The Latex
> Graphics Companion "GetCoordinates" example on page 329).  However, as I
> started to learn a bit about pstricks I started to re-write some of the
> postscript routines as well.
>
> Now for my question (or rather a request for opinion).  Is it worth it
> to create new plotstyles or just string together high level objects?  I
> will likely be plotting over 100 graphs and diagrams.

absolutely.
The question is only if it makes sense to create an own
package, eg pst-plotstyle.tex

the only problem is, that the tex files must always be TeX-compatible,
all real LaTeX stuff has to be in pst-plotstyle.sty

> 5. LineToXaxis should respect \psScalePoints.  i.e.
> \psScalePoints(1,1){}{10 add} then the line should be drawn to (x,10)
> not (x,0) this allows for spatial velocity plots.  I want to do scaled
> velocity plots on a spatial diagram.

do you have a _short_ complete example for this?

> 5. Generalized iterative non-linear regression using prototype function
> and AlgtoPS (I'll probably be leaving this one alone, but I'd love to do it)

go on!

> So what ar the implications of:
> %%%%%Pseudo Code%%%%%%
> Start TeX  Loop (i =1 to n){
> \psline(xi-1,yi-1)(xi,yi)
> \psdot(xi,yi)}
> End TeX Loop

we can implement a \psforloop{\iA=1..\n}, that should be no problem.

> Versus
>
> Tex Command{
> Start PS Loop
> Dot
> Line}
> End PS Loop
> %%%%%%%%%%%%%%%%%
>
> What is the effect on processing speed, overflow issues, final document
> load times, final document size.  Thanks very much for any advice.

PostScript is very fast and putting the data into brackets [..] or
[[...][...]...] makes reading and plotting faster.