Re: Wertepaare plotten
- From: Peter Thomassen <info@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 Jan 2006 18:00:51 +0100
Hallo Herbert,
Herbert Voss schrieb am Mittwoch, 25. Januar 2006 07:25:
> http://tug.org/PSTricks/main.cgi?file=pst-plot/DataExamples
Danke, ich mache es jetzt wie im ersten Beispiel. Allerdings erhalte ich,
wenn ich Punkte mit ganzzahligem Hochwert >= 11 plotte, links vom ersten
gezeichneten Punkt ein "D"; bei Dezimalzahlen werden außerdem noch die
Nachkommastellen angezeigt. Dadurch verrutscht der Graph nach rechts. Woran
liegt's?
<snip>
\usepackage{filecontents}
\begin{filecontents}{Daten1.dat}
[
200 11
100 0.00708794593811
]
\end{filecontents}
\begin{filecontents}{Daten2.dat}
[
2.55 2.91
2.028 5.70
]
\end{filecontents}
\usepackage{pstricks}
\usepackage{pst-plot}
\makeatletter
\newcount\pstcntD
\def\testII#1{%
\global\pstcntD=0
\pst@expandafter\testII@i{#1}\@nil%
}
\def\testII@i#1\@nil{%
\def\next##1 ##2\relax{%
\edef\@tempa{##1}%
\ifx\@tempa\@empty\else% gobble leading spaces
\ifx##1D\global\advance\pstcntD by 1\fi
\fi%
\edef\@tempa{##2}%
\ifx\@tempa\@empty\else\ifx\@tempa\space\else\next##2\relax%
\fi\fi%
}%
\expandafter\next#1 \relax}
\makeatother
....
\begin{document}
....
\psset{xunit=.01,yunit=.05,linewidth=0.4pt,dotscale=0.8}
\readdata{\Daten}{Daten1.dat}
\readdata{\Datenn}{Daten2.dat}
\begin{pspicture}[](0,0)(1000,200)
\psset{showpoints=true}
\psaxes[Dx=100,Dy=50,tickstyle=bottom]{->}(0,0)(0,0)(1000,200)
\testII\Daten%
\ifnum\pstcntD>4\psset{plotstyle=line}\else\psset{plotstyle=line}\fi%
\listplot[linecolor=blue,linewidth=1pt]{\Daten}
\testII\Datenn%
\ifnum\pstcntD>4\psset{plotstyle=curve}\else\psset{plotstyle=line}\fi%
\listplot[linecolor=red,linewidth=1pt]{\Datenn}
\end{pspicture}
</snap>
Danke,
Peter
.
- Follow-Ups:
- Re: Wertepaare plotten
- From: Herbert Voss
- Re: Wertepaare plotten
- References:
- Wertepaare plotten
- From: Peter Thomassen
- Re: Wertepaare plotten
- From: Herbert Voss
- Wertepaare plotten
- Prev by Date: Re: Tastenkombination zum Starten von LaTeX
- Next by Date: Re: Wertepaare plotten
- Previous by thread: Re: Wertepaare plotten
- Next by thread: Re: Wertepaare plotten
- Index(es):
Relevant Pages
|