How to increase the canvas of a tikzpicture without scaling plot

by manooooh   Last Updated January 14, 2018 01:23 AM

This is my first post, sorry for any mistake :D.

I have this code using TeXnicCenter program, and LaTeX->PS->PDF mode:

\begin{figure}[h]
    \centering
    \begin{tikzpicture}
        \begin{axis}[axis lines=center,xmin=-0.5,xmax=4.489,ymin=-1,ymax=2]
            \pgfplotsset{ticks=none}
            \addplot [domain=0:3.989,fill=gray!60] (\x,{1})\closedcycle;
            \addplot [domain=0:3.989,samples=100] {cos((5*x+1) r)+0.5};
            \draw[<->] (axis cs:0,-0.1) -- (axis cs:1.266,-0.1) node[below] {\footnotesize $T$};
            \draw (axis cs:1.266,1) -- (axis cs:1.266,-0.1);
            \draw[<-] (axis cs:0.05,1.05) -- (axis cs:0.4,1.5) node[above] {\footnotesize $A\, v(p)$};
        \end{axis}
    \end{tikzpicture}
\end{figure}

which the "canvas" of the tikzpicture is, I think:

Canvas of the tikzpicture

Now if I want to put some text, like

Potencia almacenada en, por ejemplo, el bobinado de un motor, que se devuelve a la compañía eléctrica

with \footnotesize size. With this, the canvas maintains the size, so the text does not shown. For example, I add this text in the next code:

\begin{figure}[h]
    \centering
    \begin{tikzpicture}
        \begin{axis}[axis lines=center,xmin=-0.5,xmax=4.489,ymin=-1,ymax=2]
            \pgfplotsset{ticks=none}
            \addplot [domain=0:3.989,fill=gray!60] (\x,{1})\closedcycle;
            \addplot [domain=0:3.989,samples=100] {cos((5*x+1) r)+0.5};
            \draw[<->] (axis cs:0,-0.1) -- (axis cs:1.266,-0.1) node[below] {\footnotesize $T$};
            \draw (axis cs:1.266,1) -- (axis cs:1.266,-0.1);
            \draw[<-] (axis cs:0.05,1.05) -- (axis cs:0.4,1.5) node[above] {\footnotesize $A\, v(p)$};
            \draw[<-] (axis cs:0.45,-0.2) -- (axis cs:0.2,-1) node[text width=4.5cm,below right] {\footnotesize Potencia almacenada en, por ejemplo, el bobinado de un motor, que se devuelve a la compañía eléctrica};
        \end{axis}
    \end{tikzpicture}
\end{figure}

The text is not displayed

I do not want this. What's more, I must add more text, so I am in problems. If I change the ymin value to ymin=-3 I can see the text, but the graphic stretches, and it looks ugly.

So the question is, is there a way to change the size of the canvas to cover more space, without changing the size of the graphic? I do not want to modify the scale of the graph, or anything like that. I just want something like this:

How I would like it to stay

to put text within the axis environment, and keeping the size of the graph.

Thanks! Regards.



Related Questions


Scale Standalone tikzpicture but retain text font size

Updated October 18, 2017 23:23 PM


Plotting a graph with several values of a parameter

Updated April 12, 2015 22:10 PM

matplotlib2tikz - compilation error for 2D

Updated April 06, 2015 18:09 PM

Uniformly spaced line markers

Updated May 30, 2015 03:10 AM