fixes to the plot code using Joosep's code
cleanup for 04_jplot.py