pgfplots - Zusätzliche Markierung im Koordinatensystem

Tabellen und Grafiken erstellen und anordnen


simande
Forum-Newbie
Forum-Newbie
Beiträge: 4
Registriert: Mi 19. Aug 2015, 20:42
Wohnort: Germany

pgfplots - Zusätzliche Markierung im Koordinatensystem

Beitrag von simande »

Servus zusammen,

ich habe eine kleine Komplikation beim Erstellen eines Diagramms mit pgfplots. Ich habe an einer bestimmten Stelle eine zusätzliche Markierung auf der X-Achste erstellt. Diese hat auch eine Beschriftung. Und die steckt jetzt unter der "normalen" Achsenbeschriftung. Mit "extra y tick style={grid=major, tick label style={yshift=-1cm}}" wollte ich sie dann nach unten verschieben, aber leider passiert einfach nichts. Es kommt zwar auch keine Fehlermeldung, aber eben auch keine verschobene Beschriftung.
Hier ist das ganze:
\documentclass[paper=a4,12pt,version=last,landscape]{scrartcl}

\usepackage{pgfplots} 
\usepackage{color}

\begin{document}

\begin{tikzpicture}
\begin{axis}[x tick label style={/pgf/number format/1000 sep=},xmin=0, xmax=0.45, ymin=0, ymax=30, xlabel=Weg\,/\,mm, ylabel=Kraft\,/\,N, extra x ticks={0.19}, extra x tick labels={\textcolor{red}{$h_c$}}, extra y tick style={grid=major, tick label style={xshift=-1cm}}],

\addplot [id=exp,mark=none,domain=0:8, very thick, color=red]{130.4*x-25.20818};

\end{axis}
\end{tikzpicture}


\end{document}

Hat vielleicht jemand einen Ratschlag, wie ich das ganze wirklich verschieben kann?
Vielen Dank schon einmal,

Simon

Gast

Beitrag von Gast »

Ich glaube Du möchtest einfach nur extra x tick style statt extra y tick style, denn Du möchtest ja auch einen X-Tick und keinen Y-Tick ändern.
\documentclass[paper=a4,12pt,version=last,landscape]{scrartcl}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[x tick label style={/pgf/number format/1000 sep=},xmin=0, xmax=0.45, ymin=0, ymax=30, xlabel=Weg\,/\,mm, ylabel=Kraft\,/\,N, extra x ticks={0.19}, extra x tick labels={\textcolor{red}{$h_c$}}, extra x tick style={grid=major, tick label style={yshift=-1cm}}],

\addplot [id=exp,mark=none,domain=0:8, very thick, color=red]{130.4*x-25.20818};

\end{axis}
\end{tikzpicture}


\end{document}

simande
Forum-Newbie
Forum-Newbie
Beiträge: 4
Registriert: Mi 19. Aug 2015, 20:42
Wohnort: Germany

Beitrag von simande »

Oje...
Danke dir :)

Antworten