Posts Tagged ‘subplot’

Interactive subplots: make all x-axes move together

Saturday, May 3rd, 2008

It’s very easy to make subplots that share an x-axis, so that when you pan and zoom on one axis, the others automatically pan and zoom as well. The key to this functionality is the sharex keyword argument, which is used when creating an axis. Here’s some example code and a video of the resulting interaction. (more…)

Create a second y-axis in matplotlib

Sunday, December 2nd, 2007

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. (more…)