4 Performing Calculations

The previous chapter described how PyXPlot can be used to plot data directly from datafiles onto graphs. Often, however, calculations need to be performed on data before they are plotted. This chapter describes the mathematical environment which PyXPlot provides for performing calculations either upon single numerical values or upon whole datasets. For simplicity, most of the examples in this chapter will act upon single numerical values, displaying the results using the print command, thus using PyXPlot essentially as a desktop calculator. In subsequent chapters, more examples will be given of the use of PyXPlot’s mathematical environment to analyse whole datasets and produce plots.