Improve TestQuantityMatplotlib test based on PR feedback