Category Archives: Tutorials

Matplotlib: How to plot subplots of unequal sizes

Sometimes we would like to focus more on some data and less on others, but still provide a visual display. The matplotlib function gridspec allows subplots of unequal size to be plotted on the same figure. How this function can be applied will be demonstrated using simulated data. Let’s simulate some common probability distributions of different statistics using Python’s numpy.random

Read more

Python: Working with text files, an example using PubMed references

My colleagues and I recently needed to identify all the PubMed references on a given topic and locate email addresses of the corresponding authors. The good news is that the Author information section of PubMed references contains one or more email addresses approximately half of the time. This meant that I could automate the extraction of these email addresses by

Read more
« Older Entries Recent Entries »