von eniem » Mi 23. Apr 2014, 11:57
Hallo Forumgemeinde,
ich stehe momentan vor einem kleinen Problem: mit Gnuplot erzeuge ich (epslatex terminal) eine .eps bzw. .tex Datei, wobei ich letztere dann direkt in meinem Latex-Dokument einbinden kann (bzw. können soll).
Ich habe hierfür zunächst ein Minimalbeispiel ausprobiert, welches ansich gut funktioniert:
Das gnuplot-Skript
reset
set terminal epslatex color lw 2 size 15cm,12cm # Terminaleinstellungen
set output 'graph.tex' # Ausgabedatei wählen
set title 'Sinuskurve' # Titel setzen
set xlabel 'Winkel $\alpha$ in Radiant' # x-Achsen Beschriftung einstellen
set ylabel '$\sin(\alpha)$' # y-Achsen Beschriftung einstellen
plot sin(x) title 'Sinus' with lines # Sinuskurve plotten
unset output # Ausgabe beenden - Datei schließen
... bzw. das Latex-Dokument in welchem die vom Gnuplot-Skript erzeugten Files (graph.tex bzw. graph.eps) eingebunden werden:
\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage{nopageno}
\usepackage{epstopdf}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{figure}[!ht]
\centering
\input{graph.tex}
\caption{Verlauf einer Sinuskurve}
\label{fig:sinuskurve}
\end{figure}
\end{document}
Das Kompilieren in der Konsole (pdflatex -enable-write18) funktioniert einwandfrei und ich bekomme den Graphen schön in einer .pdf-Datei eingebunden.
Soweit so gut. Nun wollte ich das Skript adaptieren, da ich für eine Arbeit nicht bloß Funktionen, sondern Messdaten plotte. Dabei sieht mein Gnuplot-Skript nun folgendermaßen aus:
reset
set terminal epslatex color size 9.45cm,6cm
set datafile commentschars "abcdefghijklmnopqrstuvwxyzöäüABCDEFGHIJKLMNOPQRSTUVWXYZÖÄÜ-_[](){}=/"
set style line 1 lt 1 lw 2.0 lc 1
set style line 2 lt 1 lw 2.0 lc 2
set style line 3 lt 1 lw 2.0 lc 3
set style line 4 lt 1 lw 2.0 lc 4
set style line 5 lt 1 lw 2.0 lc 5
set style line 16 lt 1 lw 4 lc rgb "#d3d3d3"
set size 1 , 1
set grid lt 3 lw 1 lc 9
set key width 0 font ",10" inside top right reverse Left samplen 1 vertical maxrows 7
set noarrow
#******************************************************************************************************
set xrange[0:40]
set xlabel 'Monate'
set format x "%.0f"
set xtics 4
set yrange[15:45]
set ylabel 'Temperatur'
set format y "%.0f"
set ytics 5
#******************************************************************************************************
unset label
set title "Temperatur"
set output '01_temp_auswertung-a-tex.tex'
plot '01_temp_mk.dat' using ($1):($2) axes x1y1 title 'Luft' with line ls 1 ,\
'01_temp_mk.dat' using ($1):($3) axes x1y1 title 'a' with line ls 2 ,\
'01_temp_mk.dat' using ($1):($4) axes x1y1 title 'b' with line ls 3 ,\
'01_temp_mk.dat' using ($1):($5) axes x1y1 title 'c' with line ls 4 ,\
'01_temp_mk.dat' using ($1):($6) axes x1y1 title 'd' with line ls 5
unset output
Wobei das Datenfile "01_temp_mk.dat" folgendermaßen aufgebaut ist:
DYNR 10.51-27 TU G Seite:
MK: RQS, kE Datum: 22.04.14
Bauteiltemperatur
Tabelle der Funktionswerte
t Temperatur 7Temperatur 7Temperatur 7Temperatur 7Temperatur 7
[h] [°C] [°C] [°C] [°C] [°C]
0.000 20.00 20.00 20.00 20.00 20.00
1.000 20.00 20.00 20.00 20.00 20.00
2.000 20.00 20.00 20.00 20.00 20.00
3.000 20.08 20.08 20.08 20.08 20.07
4.000 20.28 20.28 20.28 20.26 20.23
5.000 20.63 20.63 20.62 20.57 20.51
6.000 21.11 21.11 21.10 20.99 20.87
7.000 21.70 21.70 21.70 21.48 21.32
8.000 22.39 22.39 22.38 22.03 21.80
9.000 23.16 23.16 23.14 22.62 22.32
10.000 23.97 23.97 23.94 23.20 22.84
11.000 24.81 24.81 24.77 23.77 23.34
12.000 25.67 25.67 25.61 24.32 23.83
13.000 26.54 26.53 26.45 24.83 24.28
14.000 27.40 27.40 27.28 25.31 24.71
15.000 28.25 28.25 28.09 25.75 25.09
16.000 29.08 29.08 28.88 26.14 25.44
17.000 29.89 29.89 29.65 26.49 25.75
18.000 30.68 30.67 30.38 26.79 26.02
19.000 31.44 31.42 31.08 27.06 26.25
20.000 32.16 32.14 31.74 27.28 26.45
21.000 32.86 32.83 32.36 27.47 26.61
22.000 33.52 33.49 32.95 27.62 26.74
23.000 34.15 34.11 33.51 27.74 26.85
24.000 34.74 34.70 34.02 27.83 26.93
Wenn man gnuplot ausführt wird - erwartungsgemäß ein .eps (mit korrekt geplotteten Messdatenverläufen) und .tex-File erzeugt (01_temp_auswertung-a-tex.tex bzw. .eps). - Das funktioniert auch. Das Latex-File in dem letztlich alles eingebunden werden soll ist jenes aus dem Minimalbeispiel:
\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage{nopageno}
\usepackage{epstopdf}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{figure}[!ht]
\centering
\input{01_temp_auswertung-a-tex.tex}
\caption{Verlauf einer Sinuskurve}
\label{fig:sinuskurve}
\end{figure}
\end{document}
... so. Und hier hakt es. Wenn ich pdflatex -enable-write18 in der Konsole ausführe kommt es zum Fehler, wobei mir in der Konsole folgendes angezeigt wird:
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2013.8.21) 23 APR 2014 11:50
entering extended mode
**01_temp_auswertung-a-tex.tex
(C:\...\01_temp_auswertung-a-tex.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese,
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
! Package graphicx or graphics not loaded.
See the gnuplot documentation for explanation.
Type H <return> for immediate help.
...
l.130 ...ncludegraphics{01_temp_auswertung-a-tex}}
%
? H
The gnuplot epslatex terminal needs graphicx.sty or graphics.sty.
?
Leider kann ich mit dieser Fehlermeldung nichts anfangen; das ursprüngliche Minimalbeispiel hat ja gezeigt, dass prinzipiell alles ordnungsgemäß funktioniert und die entsprechenden Packages auch vorhanden sind.
Ein Blick in die Log-Datei liefert noch:
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2013.8.21) 23 APR 2014 11:50
entering extended mode
**01_temp_auswertung-a-tex.tex
(C:\...\01_temp_auswertung-a-tex.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese,
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
Missing character: There is no 1 in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 3 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 3 in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 4 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 4 in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 4 in font nullfont!
Missing character: There is no 8 in font nullfont!
Missing character: There is no 1 in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no 1 in font nullfont!
(etc.)
Ich bin nun etwas ratlos und würde mich freuen, falls mir jemand von euch weiterhelfen kann den Fehler zu finden ...
Besten Dank im Voraus und liebe Grüße,
eniem
Hallo Forumgemeinde,
ich stehe momentan vor einem kleinen Problem: mit Gnuplot erzeuge ich (epslatex terminal) eine .eps bzw. .tex Datei, wobei ich letztere dann direkt in meinem Latex-Dokument einbinden kann (bzw. können soll).
Ich habe hierfür zunächst ein Minimalbeispiel ausprobiert, welches ansich gut funktioniert:
Das gnuplot-Skript
[code]
reset
set terminal epslatex color lw 2 size 15cm,12cm # Terminaleinstellungen
set output 'graph.tex' # Ausgabedatei wählen
set title 'Sinuskurve' # Titel setzen
set xlabel 'Winkel $\alpha$ in Radiant' # x-Achsen Beschriftung einstellen
set ylabel '$\sin(\alpha)$' # y-Achsen Beschriftung einstellen
plot sin(x) title 'Sinus' with lines # Sinuskurve plotten
unset output # Ausgabe beenden - Datei schließen
[/code]
... bzw. das Latex-Dokument in welchem die vom Gnuplot-Skript erzeugten Files (graph.tex bzw. graph.eps) eingebunden werden:
[code]
\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage{nopageno}
\usepackage{epstopdf}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{figure}[!ht]
\centering
\input{graph.tex}
\caption{Verlauf einer Sinuskurve}
\label{fig:sinuskurve}
\end{figure}
\end{document}
[/code]
Das Kompilieren in der Konsole (pdflatex -enable-write18) funktioniert einwandfrei und ich bekomme den Graphen schön in einer .pdf-Datei eingebunden.
Soweit so gut. Nun wollte ich das Skript adaptieren, da ich für eine Arbeit nicht bloß Funktionen, sondern Messdaten plotte. Dabei sieht mein Gnuplot-Skript nun folgendermaßen aus:
[code]
reset
set terminal epslatex color size 9.45cm,6cm
set datafile commentschars "abcdefghijklmnopqrstuvwxyzöäüABCDEFGHIJKLMNOPQRSTUVWXYZÖÄÜ-_[](){}=/"
set style line 1 lt 1 lw 2.0 lc 1
set style line 2 lt 1 lw 2.0 lc 2
set style line 3 lt 1 lw 2.0 lc 3
set style line 4 lt 1 lw 2.0 lc 4
set style line 5 lt 1 lw 2.0 lc 5
set style line 16 lt 1 lw 4 lc rgb "#d3d3d3"
set size 1 , 1
set grid lt 3 lw 1 lc 9
set key width 0 font ",10" inside top right reverse Left samplen 1 vertical maxrows 7
set noarrow
#******************************************************************************************************
set xrange[0:40]
set xlabel 'Monate'
set format x "%.0f"
set xtics 4
set yrange[15:45]
set ylabel 'Temperatur'
set format y "%.0f"
set ytics 5
#******************************************************************************************************
unset label
set title "Temperatur"
set output '01_temp_auswertung-a-tex.tex'
plot '01_temp_mk.dat' using ($1):($2) axes x1y1 title 'Luft' with line ls 1 ,\
'01_temp_mk.dat' using ($1):($3) axes x1y1 title 'a' with line ls 2 ,\
'01_temp_mk.dat' using ($1):($4) axes x1y1 title 'b' with line ls 3 ,\
'01_temp_mk.dat' using ($1):($5) axes x1y1 title 'c' with line ls 4 ,\
'01_temp_mk.dat' using ($1):($6) axes x1y1 title 'd' with line ls 5
unset output
[/code]
Wobei das Datenfile "01_temp_mk.dat" folgendermaßen aufgebaut ist:
[code]
DYNR 10.51-27 TU G Seite:
MK: RQS, kE Datum: 22.04.14
Bauteiltemperatur
Tabelle der Funktionswerte
t Temperatur 7Temperatur 7Temperatur 7Temperatur 7Temperatur 7
[h] [°C] [°C] [°C] [°C] [°C]
0.000 20.00 20.00 20.00 20.00 20.00
1.000 20.00 20.00 20.00 20.00 20.00
2.000 20.00 20.00 20.00 20.00 20.00
3.000 20.08 20.08 20.08 20.08 20.07
4.000 20.28 20.28 20.28 20.26 20.23
5.000 20.63 20.63 20.62 20.57 20.51
6.000 21.11 21.11 21.10 20.99 20.87
7.000 21.70 21.70 21.70 21.48 21.32
8.000 22.39 22.39 22.38 22.03 21.80
9.000 23.16 23.16 23.14 22.62 22.32
10.000 23.97 23.97 23.94 23.20 22.84
11.000 24.81 24.81 24.77 23.77 23.34
12.000 25.67 25.67 25.61 24.32 23.83
13.000 26.54 26.53 26.45 24.83 24.28
14.000 27.40 27.40 27.28 25.31 24.71
15.000 28.25 28.25 28.09 25.75 25.09
16.000 29.08 29.08 28.88 26.14 25.44
17.000 29.89 29.89 29.65 26.49 25.75
18.000 30.68 30.67 30.38 26.79 26.02
19.000 31.44 31.42 31.08 27.06 26.25
20.000 32.16 32.14 31.74 27.28 26.45
21.000 32.86 32.83 32.36 27.47 26.61
22.000 33.52 33.49 32.95 27.62 26.74
23.000 34.15 34.11 33.51 27.74 26.85
24.000 34.74 34.70 34.02 27.83 26.93
[/code]
Wenn man gnuplot ausführt wird - erwartungsgemäß ein .eps (mit korrekt geplotteten Messdatenverläufen) und .tex-File erzeugt (01_temp_auswertung-a-tex.tex bzw. .eps). - Das funktioniert auch. Das Latex-File in dem letztlich alles eingebunden werden soll ist jenes aus dem Minimalbeispiel:
[code]
\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage{nopageno}
\usepackage{epstopdf}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{figure}[!ht]
\centering
\input{01_temp_auswertung-a-tex.tex}
\caption{Verlauf einer Sinuskurve}
\label{fig:sinuskurve}
\end{figure}
\end{document}
[/code]
... so. Und hier hakt es. Wenn ich pdflatex -enable-write18 in der Konsole ausführe kommt es zum Fehler, wobei mir in der Konsole folgendes angezeigt wird:
[code]
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2013.8.21) 23 APR 2014 11:50
entering extended mode
**01_temp_auswertung-a-tex.tex
(C:\...\01_temp_auswertung-a-tex.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese,
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
! Package graphicx or graphics not loaded.
See the gnuplot documentation for explanation.
Type H <return> for immediate help.
...
l.130 ...ncludegraphics{01_temp_auswertung-a-tex}}
%
? H
The gnuplot epslatex terminal needs graphicx.sty or graphics.sty.
?
[/code]
Leider kann ich mit dieser Fehlermeldung nichts anfangen; das ursprüngliche Minimalbeispiel hat ja gezeigt, dass prinzipiell alles ordnungsgemäß funktioniert und die entsprechenden Packages auch vorhanden sind.
Ein Blick in die Log-Datei liefert noch:
[code]
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2013.8.21) 23 APR 2014 11:50
entering extended mode
**01_temp_auswertung-a-tex.tex
(C:\...\01_temp_auswertung-a-tex.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese,
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
Missing character: There is no 1 in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 3 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 3 in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 4 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 4 in font nullfont!
Missing character: There is no 5 in font nullfont!
Missing character: There is no 0 in font nullfont!
Missing character: There is no 4 in font nullfont!
Missing character: There is no 8 in font nullfont!
Missing character: There is no 1 in font nullfont!
Missing character: There is no 2 in font nullfont!
Missing character: There is no 1 in font nullfont!
(etc.)
[/code]
Ich bin nun etwas ratlos und würde mich freuen, falls mir jemand von euch weiterhelfen kann den Fehler zu finden ...
Besten Dank im Voraus und liebe Grüße,
eniem