-
Book Overview & Buying
-
Table Of Contents
Python Automation Cookbook - Third Edition
By :
A scatter plot is one where the information is displayed as dots with X and Y values. They are very useful when presenting data with two dimensions (not necessarily a time series as seen previously) and to see whether there's any relationship between two variables. In this recipe we'll plot time spent on a website against money spent, to see whether we can see a pattern.
We can install matplotlib in our environment using the following commands:
$ echo "matplotlib==3.10.8" >> requirements.txt
$ uv pip install -r requirements.txt
As we're going to be working with data points, we'll use the scatter.csv file as the source of our data. This file is available on GitHub at https://github.com/PacktPublishing/Python-Automation-Cookbook-Third-Edition/blob/main/ch08/scatter.csv.
matplotlib, csv, and FuncFormatter (to format the axes later):
>>> import csv
>>> import matplotlib.pyplot...