plotting and more about classes the default values used in most of the examples in this book were set with the code #set line width pylab rcparams['lines linewidth' #set font size for titles pylab rcparams['axes titlesize' #set font size for labels on axes pylab rcparams['axes labelsize' #set size of numbers on -axis pylab rcparams['xtick labelsize' #set size of numbers on -axis pylab rcparams['ytick labelsize' #set size of ticks on -axis pylab rcparams['xtick major size' #set size of ticks on -axis pylab rcparams['ytick major size' #set size of markers pylab rcparams['lines markersize' if you are viewing plots on color displayyou will have little reason to customize these settings we customized the settings we used so that it would be easier to read the plots when we shrank them and converted them to black and white for complete discussion of how to customize settingssee plotting mortgagesan extended example in we worked our way through hierarchy of mortgages as way of illustrating the use of subclassing we concluded that by observing that "our program should be producing plots designed to show how the mortgage behaves over time figure enhances class mortgage by adding methods that make it convenient to produce such plots (the function findpaymentwhich is used in mortgageis defined in figure the methods plotpayments and plotbalance are simple one-linersbut they do use form of pylab plot that we have not yet seen when figure contains multiple plotsit is useful to produce key that identifies what each plot is intended to represent in figure each invocation of pylab plot uses the label keyword argument to associate string with the plot produced by that invocation (this and other keyword arguments must follow any format strings key can then be added to the figure by calling the function pylab legendas shown in figure the nontrivial methods in class mortgage are plottotpd and plotnet the method plottotpd simply plots the cumulative total of the payments made the method plotnet plots an approximation to the total cost of the mortgage over time by plotting the cash expended minus the equity acquired by paying off part of the loan it is an approximation because it does not perform net present value calculation to take into account the time value of cash