Book contents
- Frontmatter
- 1 An introduction to Mathematica
- 2 The Mathematica language
- 3 Lists
- 4 Functional programming
- 5 Procedural programming
- 6 Rule-based programming
- 7 Recursion
- 8 Numerics
- 9 Graphics programming
- 10 Front end programming
- 11 Examples and applications
- 12 Writing packages
- Appendix A How expressions are evaluated
- Appendix B Debugging
- References
- Solutions to exercises
- Index
9 - Graphics programming
Published online by Cambridge University Press: 21 March 2011
- Frontmatter
- 1 An introduction to Mathematica
- 2 The Mathematica language
- 3 Lists
- 4 Functional programming
- 5 Procedural programming
- 6 Rule-based programming
- 7 Recursion
- 8 Numerics
- 9 Graphics programming
- 10 Front end programming
- 11 Examples and applications
- 12 Writing packages
- Appendix A How expressions are evaluated
- Appendix B Debugging
- References
- Solutions to exercises
- Index
Summary
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.
- Type
- Chapter
- Information
- An Introduction to Programming with Mathematica® , pp. 269 - 308Publisher: Cambridge University PressPrint publication year: 2005