Tag Archive for 'matplotlib'

Create a second y-axis in matplotlib

Today I was trying to figure out how to plot two time series with differently scaled values. I found two_scales.py example in the matplotlib examples which describes how to do it.

Here’s a slightly simplified version of the code, and afterward a detailed explanation of what’s going on. Continue reading ‘Create a second y-axis in matplotlib’

Creating a custom bar plot in matplotlib

Bar plots are one of the simplest kinds of plots, but for some reason in many programs it’s difficult to get the labels you want, correct error bars, and control over every aspect of the plot. Here’s how to create a custom bar plot using the Python plotting module matplotlib. Continue reading ‘Creating a custom bar plot in matplotlib’