Graphs of Functions
Plotting Graphs of Curves and of Functions Wrong Plots Scaling Viewing Rectangles
Plotting Graphs with Computers (1) Computers form plots of graphs or curves by computing a number of points on the graph or curve and then connecting these points to form an approximation of the graph. Here is a plot of the curve defined by the equation
x2 y 2
2
3 x 2 y y 3 0.
The picture was generated by Maple 8 using its implicitplot command (in the plots library). To form the plot, Maple has substituted numeric values for x in the above equation and solved all these equations for y. To form the graph, Maple has then connected the computed points with straight lines.
Plotting Graphs with Computers (2)suspicious at the origin. The problem is The plot generated by Maple looks that several branches of the graph come to the origin. When Maple has computed points on the curve then it needs to figure out which points have to be connected with straight lines to form a correct plot. A better result can be obtained by using the polar coordinates. Substituting x r cos( ), y r sin( ) to the equation
x
2
y2
2
3x 2y y 3 0
and solving for r leads to the equation r sin3 3cos2 sin for the curve C.
Plotting Graphs with Computers (4) Polar coordinate representation gives immediately a parameterization of the graph. This is much better for plotting, since the parameterization also can be used to decide which points have to be connected to which points. Here are the two graphs.
Implicit plot graph
Graph by a parameterization
Scaling When plotting functions it is important to define the viewing rectangle correctly. Programs have built in methods to choose the viewing rectangle 1 but these methods do not always lead to desired results. The picture on the right was generated by Maple. It shows a portion of the graph of the function sin(50x). Maple has chosen, by default, to change scales. In this picture, x-axis and yaxis use different scales. Hence the picture is not accurate even though it may be right for the purposes needed.
0.25 -0.25
-1
f x =sin 50 x .
Viewing Rectangles – x Axis Consider again function sin(50x). Here are plots of the graph of this function for different x-intervals. Some of the plots are clearly incorrect.
Sin(50x), -6≤x≤6
Sin(50x), -10≤x≤10
Sin(50x), -0.1≤x≤0.1
Viewing Rectangles – y Axis Choosing the height of the viewing rectangle correctly is also important. If the y-axis range of the viewing rectangle is not specified, then Maple chooses it so that it can show all of the graph. This is not always a good choice.
ex+sin(x), -10≤x≤10
ex+sin(x), -10≤x≤1