[pstricks] filecontents

Poul Riis Poul.Riis at skolekom.dk
Wed Apr 8 21:35:09 CEST 2009


When I run the file below several times, each time changing some of the
data points, I get error messages because the data files already exist,
and the old versions are used. I can manually delete the files but isn't
there a way to do it automatically from the latex file?
Furthermore, I would prefer the regression line to be extended to the full
x-interval of the graph window and not only going from the data point with
the minimum x to the data point with the maximum x. Is that possible?

Poul Riis





\documentclass{article}
\usepackage{pstricks-add}

\begin{filecontents*}{semilog.dat}
80 340
160 450
320 550
640 1150
\end{filecontents*}

\begin{filecontents*}{doublelog.dat}
10 100
20 150
40 225
80 340
160 570
320 765
640 1150
\end{filecontents*}

\begin{document}

\readdata{\semilogdata}{semilog.dat}
\readdata{\doublelogdata}{doublelog.dat}

\pstScalePoints(1,1){}{log}
\psset{llx=-0.5cm,lly=-0.5cm}
\psgraph[ylogBase=10,Dx=100](0,2)(800,4){12cm}{8cm}
\psaxes[logLines=y,ylogBase=10,subtickcolor=blue,tickwidth=1pt,ysubticks=10,labels=none,dx=100,xsubticks=10,xticksize=0
2,subticksize=1](0,2)(800,4)
\listplot[linecolor=red, linewidth=2pt,
showpoints=true,linestyle=none]{\semilogdata}
\listplot[plotstyle=LSM,linecolor=green]{\semilogdata}
\endpsgraph\\[1cm]

\pstScalePoints(1,1){log}{log}
\psset{llx=-0.5cm,lly=-0.5cm}
\psgraph[xylogBase=10](1,2)(3,4){10cm}{10cm}
\psaxes[logLines=all,xsubtickcolor=blue,tickwidth=1pt,ysubticks=10,labels=none,xsubticks=10,xticksize=0
2,yticksize=0 2,subticksize=1](1,2)(3,4)
\listplot[linecolor=red, linewidth=2pt,
showpoints=true,linestyle=none]{\doublelogdata}
\listplot[plotstyle=LSM,linecolor=green]{\doublelogdata}
\endpsgraph

\end{document}



More information about the PSTricks mailing list