Abstract
In this chapter, you will look at styles and techniques for plotting two-dimensional data. You will start with some simple plots and then progress to those that include multiple sets of data on the same plot. While Python contains specialized built-in functions that can be quite efficient at this, usually requiring only a few lines of code, you will find that you can embellish your plots by taking a more hands-on approach and being creative by supplementing the specialized Python functions with simple Python commands. For example, the plot in Figure 8-1 requires only three lines of specialized code after the setup and data has been entered. Figure 8-5, on the other hand, can be a challenge to create using just specialized Python commands, but that is how it has been done by Listing 8-5. The use of simple commands, plus a little creativity, can often make the job much easier and produce better results. Following simple data plots, you will move on to linear regression where you fit a straight line to a data set. You will then see how to fit non-linear mathematical functions to the data. The last thing you explore is splines. A spline is a smooth curve that passes through each data point.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2023 Bernard Korites
About this chapter
Cite this chapter
Korites, B. (2023). 2D Data Plotting. In: Python Graphics. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-9660-8_8
Download citation
DOI: https://doi.org/10.1007/978-1-4842-9660-8_8
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-9659-2
Online ISBN: 978-1-4842-9660-8
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)