Não é possível traçar uma parábola

Não é possível traçar uma parábola

Estou fazendo um problema de múltipla escolha. (Aqui, exibo duas das opções.) Estou tentando traçar parábolas usando pgfplots. Por que não está TikZcompilando meu código? Coloquei um %na frente das parábolas que gostaria de traçar para TikZcompilar o código.

Além disso, gostaria que a imagem ficasse alinhada com a margem esquerda. Digitei \hspace{\fill}após o final do tikzpictureambiente.

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections}

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

\begin{document}


\begin{tikzpicture}
%These four commands give commands to draw a rectangle in which the graphs are to be drawn.
\draw[gray,dashed,line width=0.1pt,name path=top] (-6,4.25) -- (6,4.25);
\draw[gray,dashed,line width=0.1pt,name path=right] (6,0) -- (6,4.25);
\draw[gray,dashed,line width=0.1pt,name path=bottom] (-6,0) -- (6,0);
\draw[gray,dashed,line width=0.1pt,name path=left] (-6,0) -- (-6,4.25);

%These commands place the letters indicating the choices.
\node[left] (a) at (-6,4) {$\mathrm{a.)}$};
\node[left] (b) at (1,4) {$\mathrm{b.)}$};

%These commands place the axes for the graphs.
\draw[draw=gray!30,latex-latex] (-3.5,4) +(0,0.5cm) node[above right] {$y$} -- (-3.5,1) -- +(0,-0.5cm);
\draw[draw=gray!30,latex-latex] (-5.5,2) +(-0.5cm,0) -- (-1.5,2) -- +(0.5cm,0) node[below right] {$x$};
%\addplot[samples=201,domain=-3.75:-3.25,blue] {-4*(x + 3.5)^(2) + 1.5};

%These commands plot the second parabola on the Cartesian plane.
\draw[draw=gray!30,latex-latex] (3.5,4) +(0,0.5cm) node[above right] {$y$} -- (3.5,1) -- +(0,-0.5cm);
\draw[draw=gray!30,latex-latex] (1.5,2) +(-0.5cm,0) -- (5.5,2) -- +(0.5cm,0) node[below right] {$x$};
%\addplot[samples=201,domain=-2.75:-2.25,blue] {(x - 3.5)^(2) + 2.5};

\end{tikzpicture}
\hspace{\fill}

\end{document}

Responder1

Aqui está uma resposta parcial. Você precisará então colocar isso em seu contexto. Pessoalmente, eu construiria cada imagem gráfica com a classe autônoma construindo uma 'biblioteca' de diagramas reutilizáveis. Então eu usaria \inputgraphics para colocar os gráficos onde necessário. Mas este código responde à sua pergunta. Porém, para obter as parábolas você precisará indicar corretamente o domínio e a janela gráfica. (Deixo a matemática para você.)

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections}
\usepackage{adjustbox}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\begin{document}


a.) \adjustbox{valign=t}{\begin{tikzpicture}[scale=.5]
%These commands plot the second parabola on the Cartesian plane.
\draw[draw=gray!30,latex-latex] (3.5,4) +(0,0.5cm) node[above right] {$y$} -- (3.5,1) -- +(0,-0.5cm);
\draw[draw=gray!30,latex-latex] (1.5,2) +(-0.5cm,0) -- (5.5,2) -- +(0.5cm,0) node[below right] {$x$};
\begin{axis}[axis lines=none]\addplot[samples=201,domain=-2.75:-2.25,blue] {(x - 3.5)^(2) + 2.5};\end{axis}
% axis lines=none comes from pg 219 of the pgfplots documentation
\end{tikzpicture}}%
%
b.) \adjustbox{valign=t}{\begin{tikzpicture}[scale=.5]
%These commands plot the second parabola on the Cartesian plane.
\draw[draw=gray!30,latex-latex] (3.5,4) +(0,0.5cm) node[above right] {$y$} -- (3.5,1) -- +(0,-0.5cm);
\draw[draw=gray!30,latex-latex] (1.5,2) +(-0.5cm,0) -- (5.5,2) -- +(0.5cm,0) node[below right] {$x$};
\begin{axis}[axis lines=none]\addplot[samples=201,domain=-2.75:-2.25,blue] {(x - 3.5)^(2) + 2.5};\end{axis}
\end{tikzpicture}}%
%

c.) \adjustbox{valign=t}{\begin{tikzpicture}[scale=.5]
%These commands plot the second parabola on the Cartesian plane.
\draw[draw=gray!30,latex-latex] (3.5,4) +(0,0.5cm) node[above right] {$y$} -- (3.5,1) -- +(0,-0.5cm);
\draw[draw=gray!30,latex-latex] (1.5,2) +(-0.5cm,0) -- (5.5,2) -- +(0.5cm,0) node[below right] {$x$};
\begin{axis}[axis lines=none]\addplot[samples=201,domain=-2.75:-2.25,blue] {(x - 3.5)^(2) + 2.5};\end{axis}
\end{tikzpicture}}%
%
d.) \adjustbox{valign=t}{\begin{tikzpicture}[scale=.5]
%These commands plot the second parabola on the Cartesian plane.
\draw[draw=gray!30,latex-latex] (3.5,4) +(0,0.5cm) node[above right] {$y$} -- (3.5,1) -- +(0,-0.5cm);
\draw[draw=gray!30,latex-latex] (1.5,2) +(-0.5cm,0) -- (5.5,2) -- +(0.5cm,0) node[below right] {$x$};
\begin{axis}[axis lines=none]\addplot[samples=201,domain=-2.75:-2.25,blue] {(x - 3.5)^(2) + 2.5};\end{axis}
\end{tikzpicture}}%
%

e.) \adjustbox{valign=t}{\begin{tikzpicture}[scale=.5]
%These commands plot the second parabola on the Cartesian plane.
\draw[draw=gray!30,latex-latex] (3.5,4) +(0,0.5cm) node[above right] {$y$} -- (3.5,1) -- +(0,-0.5cm);
\draw[draw=gray!30,latex-latex] (1.5,2) +(-0.5cm,0) -- (5.5,2) -- +(0.5cm,0) node[below right] {$x$};
\begin{axis}[axis lines=none]\addplot[samples=201,domain=-2.75:-2.25,blue] {(x - 3.5)^(2) + 2.5};\end{axis}
\end{tikzpicture}}


\hspace{\fill}

\end{document}

insira a descrição da imagem aqui

Responder2

Aqui está uma enumeração de duas colunas como ambiente usando taskspacote.

\documentclass{amsart}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\usepackage[more]{tasks}
\NewTasks[style=enumerate,counter-format=tsk[a]),label-width=1em,item-indent = 1em,column-sep =2em,after-item-skip =3ex]{choices}[\choice](2)
\begin{document}
\begin{choices}
\choice
\begin{tikzpicture}[baseline=(current bounding box.north)]
\begin{axis}[hide axis,width=0.4\textwidth,clip=false]
\addplot[samples=201,domain=-3.75:-3.25,blue] {-4*(x + 3.5)^(2) + 1.5};
\draw[draw=gray!30,latex-latex] (axis cs: -3.5, 1.55) node[below right] {$y$} -- (axis cs: -3.5, 1.25);
\draw[draw=gray!30,latex-latex] (axis cs: -3.85, 1.35) -- (axis cs: -3.15, 1.35) node[below right] {$x$};
\end{axis}
\end{tikzpicture}
\choice
\begin{tikzpicture}[baseline=(current bounding box.north)]
\begin{axis}[hide axis,width=0.4\textwidth,clip=false]
\addplot[samples=201,domain=-2.75:-2.25,blue] {(x - 3.5)^(2) + 2.5};
\draw[draw=gray!30,latex-latex] (axis cs: -2.5, 42.75) node[below right] {$y$} -- (axis cs: -2.5, 35.55);
\draw[draw=gray!30,latex-latex] (axis cs: -2.85, 38) -- (axis cs: -2.15, 38) node[below right] {$x$};
\end{axis}
\end{tikzpicture}
\choice
\begin{tikzpicture}[baseline=(current bounding box.north)]
\begin{axis}[hide axis,width=0.4\textwidth,clip=false]
\addplot[samples=201,domain=-3.75:-3.25,blue] {-4*(x + 3.5)^(2) + 1.5};
\draw[draw=gray!30,latex-latex] (axis cs: -3.5, 1.55) node[below right] {$y$} -- (axis cs: -3.5, 1.25);
\draw[draw=gray!30,latex-latex] (axis cs: -3.85, 1.35) -- (axis cs: -3.15, 1.35) node[below right] {$x$};
\end{axis}
\end{tikzpicture}
\choice
\begin{tikzpicture}[baseline=(current bounding box.north)]
\begin{axis}[hide axis,width=0.4\textwidth,clip=false]
\addplot[samples=201,domain=-2.75:-2.25,blue] {(x - 3.5)^(2) + 2.5};
\draw[draw=gray!30,latex-latex] (axis cs: -2.5, 42.75) node[below right] {$y$} -- (axis cs: -2.5, 35.55);
\draw[draw=gray!30,latex-latex] (axis cs: -2.85, 38) -- (axis cs: -2.15, 38) node[below right] {$x$};
\end{axis}
\end{tikzpicture}
\choice
\begin{tikzpicture}[baseline=(current bounding box.north)]
\begin{axis}[hide axis,width=0.4\textwidth,clip=false]
\addplot[samples=201,domain=-3.75:-3.25,blue] {-4*(x + 3.5)^(2) + 1.5};
\draw[draw=gray!30,latex-latex] (axis cs: -3.5, 1.55) node[below right] {$y$} -- (axis cs: -3.5, 1.25);
\draw[draw=gray!30,latex-latex] (axis cs: -3.85, 1.35) -- (axis cs: -3.15, 1.35) node[below right] {$x$};
\end{axis}
\end{tikzpicture}
\end{choices}
\end{document}

insira a descrição da imagem aqui

informação relacionada