5

I have a node within a pgfplot that is rather long. I know I can move the node along using pos but that's not what I want, since in the actual applications I have more objects on the plot. On the other hand I have space outside of the plot, yet the plot seems to automatically crop. The MWE below displays the problem to be solved.

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.10}

\begin{document}

\begin{tikzpicture} 
    \begin{axis}[
        font=\scriptsize,
        axis lines=left,
        ]

\addplot[domain=0:30]
{10+1*x}node[sloped,pos=0.7,below]{Please show all of me even though I am long};

\end{axis} 
\end{tikzpicture}%  

\end{document}
1
  • 1
    You can use the key clip=false in the axis options... see page 325 of the 1.12 manual
    – darthbith
    Commented Feb 3, 2015 at 21:28

1 Answer 1

7

I'm sure this must have been asked already, but I cannot find a previous question, so I'll give an answer...

You need to add clip=false to the axis options, as shown on page 325 of the v1.12 pgfplots manual.

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.10}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[
        font=\scriptsize,
        axis lines=left,
        clip=false,
        ]

\addplot[domain=0:30]
{10+1*x}node[sloped,pos=0.7,below]{Please show all of me even though I am long};

\end{axis}
\end{tikzpicture}%

\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .