Fixed several bugs and tidied up code in diffraction calibration
plotting view