Improved plot format handling