Plot Achse Pfeile größer Thema ist als GELÖST markiert

Tabellen und Grafiken erstellen und anordnen


basti-fantasti-48
Forum-Century
Forum-Century
Beiträge: 151
Registriert: So 4. Apr 2021, 14:27

Plot Achse Pfeile größer

Beitrag von basti-fantasti-48 »

Hallo, ich möchte die Pfeile am Ende der Achse etwas vergrößern. Die wirken doch arg klein.

Was ist da zu tun?
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture} 
	\centering
	\begin{axis}[
		xlabel={y},
		ylabel={z},
		ymax=1,
         xticklabel={\ifdim\tick pt=0pt \else\pgfmathprintnumber{\tick}\fi},
		grid=major,
		domain=0:5,
		samples=1000,
             width=\textwidth,
            height = 8cm,
		axis lines=left,
             %heigth=5cm,
		legend pos=north west, 
		]
		
		\addplot[red,line width=1.5pt] {mod(\x,1)<1? mod(\x,1)/5:0};
		\addlegendentry{1};
		\addplot[blue,line width=1.5pt]{0.2*x};
		\addlegendentry{2};
		
\end{axis}

	\end{tikzpicture}
	\end{document}


Benutzeravatar
Stefan Kottwitz
Admin
Admin
Beiträge: 2534
Registriert: Di 8. Jul 2008, 00:39
Kontaktdaten:

Re: Plot Achse Pfeile größer

Beitrag von Stefan Kottwitz »

Hier ist eine Lösung von Jake:
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{arrows, decorations.markings}
\makeatletter
\tikzset{
    nomorepostaction/.code=\makeatletter\let\tikz@postactions\pgfutil@empty,
    my axis/.style={
        postaction={
            decoration={
                markings,
                mark=at position 1 with {
                    \arrow[ultra thick]{latex}
                }
            },
            decorate,
            nomorepostaction
        },
        thin,
        -, % switch off other arrow tips
        every path/.append style=my axis % this is necessary
          %so it works both with "axis lines=left" and "axis lines=center"
    }
}
\makeatother
\begin{document}
\begin{tikzpicture} 
	\centering
	\begin{axis}[
		xlabel={y},
		ylabel={z},
		ymax=1,
         	xticklabel={\ifdim\tick pt=0pt \else\pgfmathprintnumber{\tick}\fi},
		grid=major,
		domain=0:5,
		samples=1000,
		width=\textwidth,
		height = 8cm,
		axis lines=left,
		axis line style={my axis},
             	%heigth=5cm,
		legend pos=north west, 
		]
		\addplot[red,line width=1.5pt] {mod(\x,1)<1? mod(\x,1)/5:0};
		\addlegendentry{1};
		\addplot[blue,line width=1.5pt]{0.2*x};
		\addlegendentry{2};
	\end{axis}
\end{tikzpicture}
\end{document}
Stefan

PS: bitte nicht doppelt die gleiche Frage posten, ich muss jedes Mal die redundante Kopie löschen. Wenn Du ein Thema "nach oben holen" möchtest, dann antworte im originalen Thema mit einer Nachfrage und vllt. schonmal einem Lösungs-Ansatz.

Antworten