Kapitel/Chapter 15

"Grafik mit PSTricks"/"Graphics with PSTricks"

Kapitel/Chapter 15

Abschnitt/Section 15.4 -- Data plots

Spezielle Datenstruktur/Special data structure

% !TEX lualatex
\DocumentMetadata{}
\documentclass{article}
\usepackage{pst-plot}
% plot line as x and the last value (temperature) as y
\makeatletter
\newcounter{xVal}\setcounter{xVal}{0}
\def\psSpecialPlot{\pst@object{psSpecialPlot}}
\def\psSpecialPlot@i#1{\begin@SpecialObj\expandafter\psSpecialPlot@ii#1}
\def\psSpecialPlot@ii #1{\psSpecialPlot@iii#1}
\def\psSpecialPlot@iii#1 #2 #3 #4 #5 #6 {%
  \stepcounter{xVal}
  \psdot(\arabic{xVal},#6)%
  \@ifnextchar D{\psSpecialPlot@iii}{\end@SpecialObj}%
}
\makeatother

\begin{document}
\begin{filecontents}[noheader,force]{\jobname.data}
2013/05/01 15:54:56 18.1
2013/05/01 16:30:00 18.5
2013/05/01 17:25:34 19
2013/05/01 18:26:45 18.2
2013/05/01 19:15:43 17.6
2013/05/01 20:22:43 16.4
2013/05/01 21:18:59 16.1
2013/05/01 22:12:23 15.6
2013/05/01 23:01:17 15.3
2013/05/02 0:19:08 15
2013/05/02 1:22:34 16.2
2013/05/02 2:19:12 16.9
2013/05/02 3:43:23 17.2
2013/05/02 4:56:01 17.8
2013/05/02 5:57:59 17.2
2013/05/02 6:34:06 16.5
2013/05/02 7:17:09 16.2
2013/05/02 8:29:29 15.4
\end{filecontents}

\readdata{\data}{\jobname.data}
%\data
\bigskip
\psset{llx=-1cm,lly=-1cm,mathLabel=false}
\begin{psgraph}[Dx=5,Dy=5]{->}(0,0)(20,20){10cm}{8cm}
  \psSpecialPlot[dotsize=5pt]{\data}
\end{psgraph}

\end{document}

Zurück zur Hauptseite/Back to main page
Copyright $Id: chapter15.html 67 2023-09-07 10:11:55Z voss $