Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Section 6.11 shows how you can define a module that accepts an object of the Plot class. Because the Plot class is the base class for multiple graph types, you can call the module on a wide variety of graphs: scatter plots, bar charts, and so on.
It is also possible to write a module that examines the type of the incoming Plot object and calls methods based on whether the object is a member of a specific derived class. For example, suppose you want to draw little tick marks that indicate the distribution of the X variable at the bottom of histograms and scatter plots, as shown in Figure 9.18. (This is sometimes called a "rug plot.") This sounds relatively simple, but there are some implementation issues to consider: