helper function for Matlab figures; minor update