
Me encantaría recibir ayuda para intentar colocar este gráfico junto a las preguntas de opción múltiple.
Estoy usando el \tasks
comando para que la pregunta y el gráfico estén uno al lado del otro, sin embargo, ahora no está en línea con el resto de lo anterior.
Esto es lo que he hecho:
\question Find the equation of the following graph
\begin{tasks}(2)
\task[]
\begin{oneparchoices}
\choice $y = (x-1)(x-5)$ \\
\choice $y = \frac{4(x-1)(x-5)}{5}$ \\
\choice $y = x^2 -6x -5$\\
\choice $\frac{4(x-6)}{5}$
\end{oneparchoices}
\task[]
\pgfplotsset{
standard/.style={
axis line style = thick,
trig format=rad,
enlargelimits,
axis x line=middle,
axis y line=middle,
enlarge x limits=0.15,
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=south east}
}
}
\begin{tikzpicture}
\begin{axis}[standard,
xtick={1, 5},
ytick={4},
samples=1000,
xlabel={$x$},
ylabel={$y$},
xmin=-1,xmax=7,
ymin=-3,ymax=6]
\node[anchor=center,label=south west:$O$] at (axis cs:0,0){};
\addplot[name path=F,domain={-1:7}]{((4/5)*(x-1)*(x-5)};
\end{axis}
\end{tikzpicture}
\end{tasks}
Respuesta1
Creo (pero no estoy seguro, ya que el código que proporcionas es bastante fragmentario) lo que buscas podría ser algo como lo siguiente:
\documentclass{exam}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\pgfplotsset{
standard/.style={
axis line style=thick,
trig format=rad,
enlargelimits,
axis x line=middle,
axis y line=middle,
enlarge x limits=0.15,
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=south east
}
}
}
\begin{document}
\begin{questions}
\question Find the equation of the following graph
\begin{oneparchoices}
\choice $y = (x-1)(x-5)$ \\
\choice $y = \frac{4(x-1)(x-5)}{5}$ \\
\choice $y = x^2 -6x -5$ \\
\choice $\frac{4(x-6)}{5}$
\end{oneparchoices}
\question Find the equation of the following graph
\hfill\makebox(0.5\linewidth,0pt)[rt]{%
\begin{tikzpicture}
\begin{axis}[
standard,
xtick={1, 5},
ytick={4},
samples=1000,
xlabel={$x$},
ylabel={$y$},
xmin=-1, xmax=7,
ymin=-3, ymax=6
]
\node[anchor=center, label=south west:$O$] at (axis cs:0,0) {};
\addplot[domain={-1:7}]{((4/5)*(x-1)*(x-5)};
\end{axis}
\end{tikzpicture}%
}
\begin{oneparchoices}
\choice $y = (x-1)(x-5)$ \\
\choice $y = \frac{4(x-1)(x-5)}{5}$ \\
\choice $y = x^2 -6x -5$ \\
\choice $\frac{4(x-6)}{5}$
\end{oneparchoices}
\end{questions}
\end{document}