Graph Plotting in LaTeX Questions

Graph Plotting Applet - \graph and \multigraph Macros

 

The \graph macro embeds a graph in a question. (You can also embed Maple plots in questions using the Question Bank Editor.) The graph has its center at the origin, x and y-axes, and horizontal and vertical gridlines. The axes are labeled at each gridline.

 

The macro takes one option and five required arguments, in the following order:

 

gridlines option - number of horizontal and vertical gridlines in addition to the axes (default is 10)
formula
- formula of the function in calculator syntax, not TeX
xMin
- minimum x value on the x-axis
xMax
- maximum x value on the x-axis
yMin
- minimum y value on the y-axis
yMax
- maximum y value on the y-axis

 

The \multigraph macro plots two curves on the same axes. This macro takes one option and six required arguments, in the following order:

 

gridlines option - number of horizontal and vertical gridlines in addition to the axes (default is 10)

formula1 - formula of first function in calculator syntax, not TeX
formula2
- formula of second function in calculator syntax, not TeX
xMin
- minimum x value on the x-axis
xMax
- maximum x value on the x-axis
yMin
- minimum y value on the y-axis
yMax
- maximum y value on the y-axis

 

Example

\begin{question}{MultiFormula}
\qutext{What are the $x$-intercepts of the graph shown?
% Format: \graph[gridlines]{formula}{xMin}{xMax}{yMin}{yMax}
\graph[12]{(x-1)(x+3)}{-6}{6}{-6}{6}}
% The choice of gridlines and scale here will ensure that the axes are
% labeled at the integers -6, -5, ..., -1, 1, ..., 5, 6.
\answer{1;-3}
\end{question}

 

See Also:

Questions with Plots