Fix plot for headless sessions