Description
These macros provide a way of embedding a graph in any question. The graph will have center at the origin, x- and y-axes, and horizontal and vertical gridlines. The axes will be labelled at each gridline.
The \graph
macro plots one function, while
\multigraph
allows for plotting of two
functions on the same set of axes.
Syntax
\graph[gridlines]{formula}[xfmt]{xMin}{xMax}[yfmt]{yMin}{yMax}
- gridlines option
- Number of horizontal and vertical gridlines. Default is 10.
- formula
- Formula of the function in calculator syntax, not TeX.
- xfmt option
- Format of the number labels along the x-axis (see below).
- xMin
- Minimum x value on the x-axis.
- xMax
- Maximum x value on the x-axis.
- yfmt option
- Format of the number labels along the y-axis (see below).
- yMin
- Minimum y value on the y-axis.
- yMax
- Maximum y value on the y-axis.
\multigraph[gridlines]{formula1}{formula2}[xfmt]{xMin}{xMax}[yfmt]{yMin}{yMax}
- gridlines option
- Number of horizontal and vertical gridlines. Default is 10.
- formula1
- Formula of one function in calculator syntax, not TeX.
- formula2
- Formula of another function in calculator syntax, not TeX.
- xfmt option
- Format of the number labels along the x-axis (see below).
- xMin
- Minimum x value on the x-axis.
- xMax
- Maximum x value on the x-axis.
- yfmt option
- Format of the number labels along the y-axis (see below).
- yMin
- Minimum y value on the y-axis.
- yMax
- Maximum y value on the y-axis.
Notes
- The
xfmt
andyfmt
arguments use the syntax of the JavaDecimalFormat
class. This syntax is similar to Excel cell formatting. Please refer to theDecimalFormat
documentation for complete details. - Rather than using EDU's basic graphing
applet, authors can also embed Maple® plots using the
\drawMaplePlot
and\drawMaplePlot3d
macros. This provides access to all of Maple's plotting capabilities. These macros can be used in any question type.
Examples
\begin{question}{Multi Formula} \qutext{What are the $x$-intercepts of the graph shown: % Format: \graph[gridlines]{formula}[xfmt]{xMin}{xMax}[yfmt]{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 % labelled at the integers -6, -5, ..., -1, 1, ..., 5, 6. \answer{1;-5} \end{question}
\begin{question}{Numeric} \qutext{Find the slope of the line graphed below. \graph{200000*x + 50000}{-10}{10}[0.###E0]{-5000000}{5000000}} \answer{200000} \err{10000} \end{question}