The guides to regression may be useful to read in conjunction with this page.
This script reads in data from CSV files and outputs plotted graphs, and can be run on single, multiple or all CSV files within a directory.
Script for graph plotting and non-linear regression (Python) ↓
The script accepts filenames as arguments, eg:
python plot.py file1.csv
python plot.py file1.csv file2.csv
python plot.py *.csv
The script includes a number of configurable options which can be set in the script including:
Defining columns to be used for the x and y values
Axes labels
Limits for the axes
Data manipulation (see guide)
Inclusion of a line of best fit
Linear regression output (gradient and intercept values), including collation of the parameters into a separate file
Iterative non linear regression
The script is capable of carrying out calculations on the data prior to plotting. This might be a simple unit conversion, eg time in minutes to time in seconds, where x = x*60, or might involve more complex functions.The document below contains some example calculations. The calculations are using numpy. If you wish to perform an arithmetic function not listed in the support document, try searching 'numpy' and the function you wish to use.