Skip to main content Accessibility help
×
Hostname: page-component-84b7d79bbc-g7rbq Total loading time: 0 Render date: 2024-07-26T14:22:15.748Z Has data issue: false hasContentIssue false

9 - Graphics programming

Published online by Cambridge University Press:  21 March 2011

Paul R. Wellin
Affiliation:
Wolfram Research Inc., Illinois
Richard J. Gaylord
Affiliation:
University of Illinois, Urbana-Champaign
Samuel N. Kamin
Affiliation:
University of Illinois, Urbana-Champaign
Get access

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
Publisher: Cambridge University Press
Print publication year: 2005

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org 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.

  • Graphics programming
  • Paul R. Wellin, Wolfram Research Inc., Illinois, Richard J. Gaylord, University of Illinois, Urbana-Champaign, Samuel N. Kamin, University of Illinois, Urbana-Champaign
  • Book: An Introduction to Programming with Mathematica®
  • Online publication: 21 March 2011
  • Chapter DOI: https://doi.org/10.1017/CBO9780511801303.009
Available formats
×

Save book 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 Dropbox.

  • Graphics programming
  • Paul R. Wellin, Wolfram Research Inc., Illinois, Richard J. Gaylord, University of Illinois, Urbana-Champaign, Samuel N. Kamin, University of Illinois, Urbana-Champaign
  • Book: An Introduction to Programming with Mathematica®
  • Online publication: 21 March 2011
  • Chapter DOI: https://doi.org/10.1017/CBO9780511801303.009
Available formats
×

Save book to Google Drive

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.

  • Graphics programming
  • Paul R. Wellin, Wolfram Research Inc., Illinois, Richard J. Gaylord, University of Illinois, Urbana-Champaign, Samuel N. Kamin, University of Illinois, Urbana-Champaign
  • Book: An Introduction to Programming with Mathematica®
  • Online publication: 21 March 2011
  • Chapter DOI: https://doi.org/10.1017/CBO9780511801303.009
Available formats
×