Graphics Reference
In-Depth Information
Figure 13-5. A user-defined function
By default, the function is calculated at 101 points along the xrange. If you have a rapidly fluc-
tuating function, you may be able to see the individual segments. To smooth out the curve, pass
a larger value of n to stat_function() , as in stat_function(fun=myfun, n=200) .
See Also
For plotting predicted values from model objects (such as lm and glm ), see Adding Fitted Lines
from an Existing Model .
Shading a Subregion Under a Function Curve
Problem
You want to shade part of the area under a function curve.
Search WWH ::




Custom Search