Using the Science Collection
This chapter describes how to use the PLT Scheme Science Collection and introduces its conventions.
2.1 An Example
The following code demonstrates the use of the PLT Scheme Science Collection by plotting a histogram of 10,000 trials of rolling two dice.
(require (planet "randomsource.ss" ("williams" "science.plt"))) (require (planet "discretehistogramwithgraphics.ss" ("williams" "science.plt"))) (let ((s (makerandomsource)) (h (makediscretehistogram))) (randomsourcerandomize! s) (do ((i 0 (+ i 1))) ((= i 10000) (void)) (let ((die1 (+ (randomuniformint 6) 1)) (die2 (+ (randomuniformint 6) 1))) (discretehistogramincrement! h (+ die1 die2)))) (discretehistogramplot h "Histogram of Sum of Two Dice"))
Figure 1 shows an example of the resulting histogram.

2.2 Loading Modules in the Science Collection
The PLT Scheme Science Collection is a collection of modules each of which provides a specific area of functionality in numerical computing. Typical user code will only load the modules it requires using the require special form.
For example, the code in Section 2.1 requires two of the modules from the science collection: randomsource and discretehistogramwithgraphics. This is specified using the following:
(require (planet "randomsource.ss" ("williams" "science.plt"))) (require (planet "discretehistogramwithgraphics.ss" ("williams" "science.plt")))
Each of these statements will load the corresponding module from the science collection  assumming they are not already loaded  and make it available for use. PLT Scheme will automatically download and install the science collection from the PLaneT server as needed.
There are two subcollections of the science collection. These are:
specialfunctions
randomdistributions
Loading modules from one of these subcollections requires that the subcollection also be specified when using the require special form. For example, to load the module for the Gaussian random distribution, the following is used:
(require (planet "gaussian.ss" ("williams" "science.plt") "randomdistributions")
As a shortcut, the entire science collection can be loaded using one of the following, depending on whether or not the graphics routines are needed:
(require (planet "science.ss" ("williams" "science.plt"))) (require (planet "sciencewithgraphics.ss" ("williams" "science.plt")))
2.3 Graphics Modules
Support for the graphical functions within the modules of the science collection has been separated from the fundamental numerical computing functionality of the modules. This facilitates the use of the numerical computing functions in nongraphical environments or when alternative graphical presentations are desired.
By convention, when graphical functions are included for a specific numerical computing area, there are three modules that provide the functions:
module  the basic numerical computing functions
modulegraphics  the graphical functions
modulewithgraphics  both the basic numerical computing and graphical functions
In general, either the module or modulewithgraphics module is loaded. However, the modulegraphics module can be loaded when only the graphical routines are being referenced.^{2}
For example, the code in Section 2.1 requires both the basic numerical computing and graphical functions for the discrete histogram functionality. Therefore, it loads the discretehistogramwithgraphics module using the form:
(require (planet "discretehistogramwithgraphics.ss" ("williams" "science.plt")))
The graphical routines are implemented using the plot collection provided with PLT Scheme (PLoT Scheme)[7]. The plot collection is, in turn, implemented using MrEd[5]. Both of these modules are required to be present to use the graphical functions.^{3}