KA786
Mechanical
- May 20, 2015
- 1
Write a function sympy_grapher(expression, granularity=0.1, limits=[-10,10,-10,10]) which takes a string containing a
sympy expression, an optional parameter granularity which represents how far apart each x-axis point is that you
should graph, and an optional parameter limits, a tuple representing your (x-min, x-max, y-min and y-max) axis limits.
Note that limits are inclusive (ie your minimum and maximum points should also be calculated and graphed).
The function should returns a pyplot object (i.e., plt) that graphs the expression (ie a graph of y = expression)
to the granularity and limits variables specified.
sympy expression, an optional parameter granularity which represents how far apart each x-axis point is that you
should graph, and an optional parameter limits, a tuple representing your (x-min, x-max, y-min and y-max) axis limits.
Note that limits are inclusive (ie your minimum and maximum points should also be calculated and graphed).
The function should returns a pyplot object (i.e., plt) that graphs the expression (ie a graph of y = expression)
to the granularity and limits variables specified.