Mathematical Principles for Scientific Computing and Visualization  
http://www.farinhansford.com/books/scv
by Gerald Farin and Dianne Hansford


This notebook illustrates a graph that is a function and one that is not.
This example corresponds to Figure 7.1 in the text.


See Chapter 7: Background: Numerical Calculus for details.

Updated May 2008

(* Set output folder to folder this file lives in *)

(SetDirectory[ToFileName[Extract["FileName"/.NotebookInformation[EvaluationNotebook[]],{1},FrontEnd`FileName]]];) 

(* Define plot1, which is a function *)

plot1=Plot[3 (x^2)+Sin[5 x]-0.5`,{x,-0.7`,1},PlotStyle->{{Thickness[0.01`],GrayLevel[0.5`]},{Thickness[0.01`]}},Ticks->None]

(* Define plot2, which is not a function because for a given x-values, there are instances where there are two associated y-values. *)
plot2=ParametricPlot[{Cos[x]+2,Sin[2 x]},{x,-4,0.5`},PlotStyle->{Thickness[0.01`]}, Ticks->None]

(* Plot the two curves together *)
final=Show[{plot1,plot2}, PlotRange->Automatic]

(* Create a postscript plot *)
Export["funcnofunc.eps",final]