Wednesday, February 12, 2020

Python hints for gain comparison script

Sources for fixing my bad coding for making the data graphs:

Directly setting the tick labels in matplotlib. Haven't gone here yet but this is apparently not a simple tweak although there is a formula for getting it right: https://stackoverflow.com/questions/11244514/modify-tick-label-text
The .plot() method for matplotlib and how it so nicely allows for multiple lines on the same plot: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.plot.html
Extracting a column from a 2D list. 3 methods: 1) list conprehension, 2) just use numpy 3) zip https://stackoverflow.com/questions/30062429/python-how-to-get-every-first-element-in-2-dimensional-list/30062458
Initializing a list for my x axis values, explained for babies: https://www.science-emergence.com/Articles/How-to-create-a-list-of-numbers-in-python-/
Doing multiplication and division between elements of three arrays: Just use numpy. https://stackoverflow.com/questions/10271484/how-to-perform-element-wise-multiplication-of-two-lists