To make a good schematic, copy, adapt, and refine

Scientific papers are built by taking existing ideas, applying them in new ways, adapting them to fit new situations, and improving them over time. Yet when it comes to drawing a schematic, many people start from scratch or never even start. Instead, start with an image search, let Inkscape do the hard work, and refine the best parts of other schematics.

I will use a figure of mine as a case study:

This schematic encapsulates the oceanographic processes that I examine in my PhD. I use it in many presentations, my thesis, and my personal website.

Continue reading “To make a good schematic, copy, adapt, and refine”

Vector and raster in one with Matplotlib

Vector images are great, except when they shouldn’t be vector. Figures with intricate detail can actually benefit from being rasterized. This can reduce file size and help the figure load more quickly. Python’s Matplotlib has an option to rasterize certain elements, but it doesn’t always work as simply as expected.

This post describes a function that (i) lets you rasterize any chosen elements when you export the figure and (ii) overcomes problems with the current implementation of rasterizing objects with Matplotlib.

Continue reading “Vector and raster in one with Matplotlib”

Matplotlib animations the easy way

Creating animations with Python’s Matplotlib is quick and easy once you know how to do it. However, when learning I found the tutorials and examples online either daunting, overly sophisticated, or lacking explanation. In many cases all I need is a quick-and-dirty script that works, rather than longer code that adheres to best practices.

Continue reading “Matplotlib animations the easy way”