Plotting 4 curves in a single plot, with 3 y-axes

This is a great chance to introduce you to the File Exchange. Though the organization of late has suffered from some very unfortunately interface design choices, it is still a great resource for pre-packaged solutions to common problems. Though many here have given you the gory details of how to achieve this (@prm!), I had a similar need a few years ago and found that addaxis worked very well. (It was a File Exchange pick of the week at one point!) It has inspired later, probably better mods. Here is some example output:

addaxis example
(source: mathworks.com)

I just searched for “plotyy” at File Exchange.

Though understanding what’s going on in important, sometimes you just need to get things done, not do them yourself. Matlab Central is great for that.

Leave a Comment