Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 9. Drawing on Graphs > 9.5 Case Study: A Module to Draw a Rug Plot on a...

9.5 Case Study: A Module to Draw a Rug Plot on a Graph

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:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint