I have some problems concerning the command \centering
. I want to put a tikzpicture
in the center of the page but I can't do it. I tried with \centering
and with \begin{center}...\end{center}
but nothing happened.
I have also a problem with axis: I want to resize them but I don't know how to do it. Thank you in advance.
The code is:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{center}
\begin{tikzpicture}
\begin{axis}
[scale=2.5,axis lines=middle,
enlargelimits,
xtick={0,1.57,3.14,6.28},ytick={0.5,1},
xticklabels={0,$\displaystyle \frac{\pi}{2}$,$\pi$, $2\pi$},
yticklabels={$1/2$, $1$},
xlabel=$x$,ylabel=$y$,axis equal]
\addplot
[domain=-2*pi:2*pi,samples=100,thick,blue]
{(sin(deg(x)))^2+cos(deg(x))};
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
\begin{center}...\end{center}
adds some vertical space which might not be wanted. (Off-topic for the real issue). Please don't ask more than one question per post.