MATLAB is quite useful for analyzing experimental data. However, making nice figures in MATLAB can sometimes be a tedious job. You might spend more time adjusting the properties of your plots than actually analyzing the data. Well, the figures need to look good!
In R, everybody makes nice plots with ggplot2, while MATLAB plots tend to look ugly unless you put in a lot of work. I wanted something like ggplot2 for MATLAB, and I came across gramm, a toolbox developed by Pierre Morel, which turned out to be very useful. Gramm stands for grammar of graphics for MATLAB, the same idea that ggplot2 is built on. The nice thing about gramm is that you can make quite complicated figures with relatively few lines of code.
Download the gramm toolbox from the GitHub repository. You can either download the ZIP file or clone the repository using git. Add the folder containing the @gramm class folder to your MATLAB path. You can do this using the MATLAB GUI or simply using the addpath() command.
addpath('path/to/gramm')
And you are ready!
The basic idea is to provide the data, specify how you want to represent the data, and then draw the figure.
g = gramm('x', x, 'y', y);
g.geom_point();
g.draw();
You can also group the data using colors, plot statistical summaries, and make multiple subplots. Quite useful when comparing data from different experimental conditions.
The Getting Started guide has some instructions to get started. However, I find this page of examples much more helpful for figuring out the different things one can do with gramm. It has a collection of figures along with the corresponding MATLAB code. Just find something similar to what you want to plot and modify the code accordingly!