Introduction to Mathematica 
Graphics

The Class

Violeta M. Ivanova, Ph.D., Educational Technology Consultant, MIT Academic Computing
Contact: N42-250J, 617-252-1383, violeta@mit . edu
Class materials: http://web.mit.edu/acmath/math/IntroMathematica
Web site: http://web.mit.edu/violeta/www/IAP2006

References

Mathematica 5.2 Documentation, Wolfram Research Inc., http://documents.wolfram.com/mathematica

Exercise One
Curve Fit to Points

Create the 2D graph below, where:
1. The red dots represent the points in the list Prime[i + 1]/Prime[i]for i=1, 2, ..., 100. (This is the same list of points we used in Session 3: Linear Algebra and Calculus.)
2. The blue line is an exponential fit to the points of the type y (x) =  
        a + b (e^(µ x)) . 
Hints:
a) If you want to do a best fit, use statistical functions from the ContinuousDistributions and NonlinearFit packages. 
b) Alternatively, if you want to practice only graphics, you may use a function like, for example, y (x)  =  
        1 + 
          0.7 (e^(0.2 x)).

SOLUTION:

Exercise Two
World Cities

Create the bar chart graph below, where:
1. The bars are the distances from Boston to several world cities.
2. The distances are shown above the bars (rounded to the nearest integer) and the title reads "Distances [km] from Boston to World Cities". 
Hints: 
a) Use city data from the add-on package CityData. Create the bar chart for cities of your choice and use a color scheme you like. 
b) Which package do you need to load to get the BarChart function?
c) You can calculate distances one by one, but a more elegant solution is to make the function you need Listable. 
You can see the graph better in the image file bostonandcities.JPG.

SOLUTION:

Exercise Three
Surface Fit to Points

Point data set copyright 2002-2006 Violeta Ivanova.

Create the 3D graph below, where:
1. The red dots are the points in file XYZpoints.txt. (This is the same list of points we used in Session 1: Interface and Basics.)
2. The surface is a triangulated mesh fit to the points. 
Hints:
a) You need to set your current directory to your work directory, before you can import the points from file XYZpoints.txt. 
b) Use functions from the ComputationalGeometry package to create the triangulated surface. 
c) Which package do you need to load in order to use function ScatterPlot3D?

SOLUTION: