Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 3
Bild hinzugefügt

30 Jul '14, 17:30

Johannes's gravatar image

Johannes
7.3k294566

pgf-plot mit zwei Achsen

Hallo zusammen! Ich bin auf Empfehlung hier gelandet. Ich habe ein Problem mit einem plot mit zwei Ordinaten. Auf der linken Ordinate werden oben und unten jeweils Linien angezeigt, die der Größe der Achsen-Hilfslinien entsprechen. Da diese grau sind und die Achse schwarz, sieht es nicht sehr professionell aus. Manchen mag dies wie eine Kleinigkeit vorkommen, ich allerdings mache es gerne richtig, wenn ich es richtig mache ;-) Der Code meines Diagramms sieht folgendermaßen aus. %\RequirePackage{filecontents} \begin{filecontents}{\jobname B.dat} 25.0 17.3 27.4 17.9 29.7 19.1 32.1 20.2 34.5 21.3 36.9 22.7 39.2 23.8 41.6 24.8 44.0 26.2 46.4 27.2 48.7 28.2 51.1 29.3 53.5 30.5 55.9 31.6 58.2 32.9 60.6 34.2 63.0 35.1 65.4 36.4 67.7 37.5 70.1 38.5 72.5 39.6 74.9 40.8 77.2 42 79.6 43.3 82.0 44.5 84.4 45.5 86.7 46.5 89.1 47.6 91.5 48.8 93.9 49.9 96.2 51.1 98.6 52.2 \end{filecontents} \begin{filecontents}{\jobname A.dat} 25.0 691 27.4 654 29.7 641 32.1 629 34.5 619 36.9 615 39.2 606 41.6 596 44.0 594 46.4 585 48.7 579 51.1 574 53.5 570 55.9 566 58.2 564 60.6 563 63.0 557 65.4 556 67.7 554 70.1 549 72.5 547 74.9 545 77.2 544 79.6 544 82.0 542 84.4 539 86.7 536 89.1 535 91.5 533 93.9 532 96.2 531 98.6 529 \end{filecontents} \documentclass{scrbook} \usepackage{pgfplots} \usepackage{siunitx} \usepgfplotslibrary{units} \pgfplotsset{ width=\textwidth, height = 0.4\textheight, compat=newest, minor tick style={black}, legend style={cells={anchor=west}}, every axis legend/.append style={at={(0.99, 0.99)}, anchor=northeast}, ticklabel shift={0.05cm} } \begin{document} \begin{figure}[htb] \centering \begin{tikzpicture} \begin{axis}[grid = major, width = \textwidth-45pt, height = 0.4\textheight,% max space between ticks=50, xlabel near ticks, ylabel near ticks, xlabel = {Scherrate}, x unit=\si{\second}, ylabel = {aaa}, y unit=\si{\percent}, xmin=0, xmax=100, ymin=400, ymax=700, x tick label style={/pgf/number format/1000 sep=} ] \addplot[color = blue, mark = none] table {\jobname A.dat}; \label{Viskosität} \end{axis} \begin{axis}[ylabel near ticks, width = \textwidth-45pt, height = 0.4\textheight, axis y line*=right, ylabel = {xxx}, y unit=\si{\percent}, xmin=0, xmax=100, ymin=0, ymax=300, x tick label style={/pgf/number format/1000 sep=}, legend pos=north east, legend cell align=left, legend style={at={(0.99,0.99)}} ] \addplot[color = red, mark = none] table {\jobname B.dat}; \addlegendimage{/pgfplots/refstyle=Viskosität} \addlegendentry{Schubspannung} \addlegendentry{Viskosität} \end{axis} \end{tikzpicture} \end{figure} \end{document} ![texweltVolkerPgfplots][1] Ich nutze WinEdt 7.0 (Update auf 8 hat auch nicht geholfen) und Miktex 2.9 Vielen Dank schon mal. Gruß [1]: http://texwelt.de/wissen/upfiles/texweltVolkerPgfplots.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2
Minimalbeispiel gebastelt

30 Jul '14, 17:24

Johannes's gravatar image

Johannes
7.3k294566

pgf-plot mit zwei Achsen

Hallo zusammen! Ich bin auf Empfehlung hier gelandet. Ich habe ein Problem mit einem plot mit zwei Ordinaten. Auf der linken Ordinate werden oben und unten jeweils Linien angezeigt, die der Größe der Achsen-Hilfslinien entsprechen. Da diese grau sind und die Achse schwarz, sieht es nicht sehr professionell aus. Manchen mag dies wie eine Kleinigkeit vorkommen, ich allerdings mache es gerne richtig, wenn ich es richtig mache ;-) Der Code meines Diagramms sieht folgendermaßen aus. \documentclass[11pt,a4paper,oneside,chapterprefix,numbers=enddot]{scrbook} %\RequirePackage{filecontents} \begin{filecontents}{\jobname B.dat} 25.0 17.3 27.4 17.9 29.7 19.1 32.1 20.2 34.5 21.3 36.9 22.7 39.2 23.8 41.6 24.8 44.0 26.2 46.4 27.2 48.7 28.2 51.1 29.3 53.5 30.5 55.9 31.6 58.2 32.9 60.6 34.2 63.0 35.1 65.4 36.4 67.7 37.5 70.1 38.5 72.5 39.6 74.9 40.8 77.2 42 79.6 43.3 82.0 44.5 84.4 45.5 86.7 46.5 89.1 47.6 91.5 48.8 93.9 49.9 96.2 51.1 98.6 52.2 \end{filecontents} \begin{filecontents}{\jobname A.dat} 25.0 691 27.4 654 29.7 641 32.1 629 34.5 619 36.9 615 39.2 606 41.6 596 44.0 594 46.4 585 48.7 579 51.1 574 53.5 570 55.9 566 58.2 564 60.6 563 63.0 557 65.4 556 67.7 554 70.1 549 72.5 547 74.9 545 77.2 544 79.6 544 82.0 542 84.4 539 86.7 536 89.1 535 91.5 533 93.9 532 96.2 531 98.6 529 \end{filecontents} \documentclass{scrbook} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{width=\textwidth, \usepackage{siunitx} \usepgfplotslibrary{units} \pgfplotsset{ width=\textwidth, height = 0.4\textheight,compat=newest, 0.4\textheight, compat=newest, minor tick style={black}, style={black}, legend style={cells={anchor=west}},every style={cells={anchor=west}}, every axis legend/.append style={at={(0.99,0.99)},anchor=northeast}, style={at={(0.99, 0.99)}, anchor=northeast}, ticklabel shift={0.05cm}} shift={0.05cm} } \begin{document} \begin{figure}[htb] \centering \begin{tikzpicture} \begin{axis}[grid = major, width = \textwidth-45pt, height = 0.4\textheight,% max space between ticks=50, xlabel near ticks, ylabel near ticks, xlabel = {Scherrate}, x unit=\si{\second}, ylabel = {aaa}, y unit=\si{\percent}, xmin=0, xmax=550, xmax=100, ymin=400, ymax=700, x tick label style={/pgf/number format/1000 sep=} ] \addplot[color = blue, mark = none] table {Diagramm1.txt}; {\jobname A.dat}; \label{Viskosität} \end{axis} \begin{axis}[ylabel near ticks, width = \textwidth-45pt, height = 0.4\textheight, axis y line*=right, ylabel = {xxx}, y unit=\si{\percent}, xmin=0, xmax=550, xmax=100, ymin=0, ymax=300, x tick label style={/pgf/number format/1000 sep=}, legend pos=north east, legend cell align=left, legend style={at={(0.99,0.99)}} ] \addplot[color = red, mark = none] table {Diagramm2.txt}; {\jobname B.dat}; \addlegendimage{/pgfplots/refstyle=Viskosität} \addlegendentry{Schubspannung} \addlegendentry{Viskosität} \end{axis} \end{tikzpicture} \end{figure} \end{document} Ich nutze WinEdt 7.0 (Update auf 8 hat auch nicht geholfen) und Miktex 2.9 Vielen Dank schon mal. GrußGruß
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

30 Jul '14, 16:58

Volker%20Racho's gravatar image

Volker Racho
1654612

Willkommen, erstes Mal hier? Schau mal unter FAQ!

×