1

I have a problem with tikzpicture inside the environment "wrapfloat". The code works well for the first tikz picture, but for the second and the following figure, the text doesn't wrap the figure. This is my code

\documentclass[10pt,a4paper,openright,oneside]{article}
\usepackage[italian]{babel}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{newlfont}
\usepackage{amssymb, graphicx, pgfplots, wrapfig}
\pgfplotsset{/pgf/number format/use comma,compat=newest,standard/.style={
    axis x line=middle,
    axis y line=middle,
    enlarge x limits=0.1,
    enlarge y limits=0.15,
    every axis x label/.style={at={(current axis.right of       origin)},anchor=north west},
    every axis y label/.style={at={(current axis.above origin)},anchor=north east}
}}
\usepackage{amsmath}
\usepackage{latexsym, tikz}
\usetikzlibrary{decorations.pathmorphing,patterns, shapes, arrows.meta}
\usepackage{amsthm}


\begin{document}
\section{Risalire all'equazione di una curva partendo dal grafico}
\begin{wrapfloat}{figure}{i}{0.4\textwidth}
\begin{tikzpicture}
\begin{axis}[standard,
ytick={1,2}, yticklabels={$1$,$2$}, xtick={-1}, xticklabels={$-1$},
xlabel=$x$,ylabel=$y$,width=6cm, height=6cm,
xmin=-3, 
xmax= 3, 
ymin=-1, 
ymax=3]
\addplot [domain=-4:4,samples=700,smooth] {(x+1)^2+1};
\draw [dashed] (-1,0)--(-1,1);
\draw [dashed] (0,1)--(-1,1);
\end{axis}
\end{tikzpicture}
\end{wrapfloat}
\textbf{text} text

text text text \\
\begin{wrapfloat}{figure}{i}{0.8\textwidth}
\begin{tikzpicture}
\begin{axis}[standard,
ytick={0,0}, yticklabels={$O$}, xtick={0,0}, xticklabels={$O$},
xlabel=$x$,ylabel=$y$,width=9cm, height=9cm,
xmin=-7, 
xmax= 7, 
ymin=-3, 
ymax=7]
\addplot [domain=-5:5,samples=700,smooth] {0.3*(x)^2};
\addplot [domain=-5:5,samples=700,smooth, green] {0.3*(x)^2+3};
\addplot [domain=-5:5,samples=700,smooth, red] {0.3*(x)^2-3};
\draw [->] (0.5,1)--(0.5,2.5);
\draw [->] (0.5,-0.8)--(0.5,-2.3);
\node [] at (1.2,1.7) {$\tiny{+m}$};
\node [] at (1.2,-1.7) {$\tiny{-m}$};
\end{axis}
\end{tikzpicture}
\end{wrapfloat}
\noindent text text\\
\begin{wrapfloat}{figure}{i}{0.8\textwidth}
\begin{tikzpicture}
\begin{axis}[standard,
ytick={0,0}, yticklabels={$O$}, xtick={0,0}, xticklabels={$O$},
xlabel=$x$,ylabel=$y$,width=9cm, height=9cm,
xmin=-12, 
xmax= 12, 
ymin=-3, 
ymax=7]
\addplot [domain=-12:12,samples=700,smooth] {0.3*(x)^2};
\addplot [domain=-12:12,samples=700,smooth, green] {0.3*(x+6)^2};
\addplot [domain=-12:12,samples=700,smooth, red] {0.3*(x-6)^2};
\draw [->] (0.5,1)--(0.5,2.5);
\draw [->] (0.5,-0.8)--(0.5,-2.3);
\node [] at (1.2,1.7) {$\tiny{+m}$};
\node [] at (1.2,-1.7) {$\tiny{-m}$};
\end{axis}
\end{tikzpicture}
\end{wrapfloat}


\end{document}

Thanks in advance!

5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.