adjusting matplotlib snippets