Published online by Cambridge University Press: 21 March 2011
Mathematica contains a rich set of tools for visualizing functions and data. Generally the built-in graphics functions will provide what you need, but, just like the rest of the Mathematica programming language, you will periodically find yourself with the need to create your own plotting and visualization routines. In this chapter we will discuss how to construct graphical images using Mathematica, and how to write programs that solve problems that are graphical in nature.
Structure of graphics
All Mathematica graphics are constructed from objects called graphics primitives. These primitive elements (Point, Line, Polygon, Circle, etc.) are used by built-in functions such as Plot to create graphics. Although it is quite straightforward to create images using Mathematica's built-in functions, you will frequently find yourself having to create a graphic image for which no Mathematica function exists. This is analogous to the situation in programming where you often have to write a specialized procedure to solve a particular problem. We use the basic building blocks and put them together according to the rules governing the structure of the language and the nature of the problem at hand. In this section we will look at the building blocks of graphics programming and at how we put them together to make graphics.
Primitives, directives, and options
Graphics created with functions such as Plot and ListPlot are constructed of lines connecting points, with options governing the display.
To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.