mPlot is an enhanced plotting engine that extends the basic plotting functionality delivered with Matlab. The purpose of mPlot is to consolidate daily plotting and formatting tasks into a single, easy-to-use object. Provided within the class are both high-level and low-level functionality. The class has 10 predefined, unique line visual settings. These can be cycled through in order to compare multiple data sets on a given plot while maintaining unique visual properties for each data set.
The class methods are layered in such a way that inheritance can be employed to build on top of the mPlot class. This allows one to extend mPlot’s functionality while leveraging the provided code. This also means one can easily redefine all of the line colors, as demonstrated at http://matlabmafia.com/?p=104
A series of tutorials detailing the construction of the mPlot class as well as examples implementing an mPlot object can be found at http://matlabmafia.com/?p=21
*Note: The Matlab class syntax used for mPlot is only supported in Matlab 2008a and later.
% Example 1 - Test 5 colors
m = mPlot(); %instantiate mPlot object
m.isAutoIncrementing = 1; % enable auto-incrementing through visual line styles
m.setGlobalMarkerSize(8); %increase marker size
for i=1:5 %loop through and plot
title('Example 1 - Test 5 colors');
Erik Lee (2021). mPlot - Enhanced Plotting Engine (https://www.mathworks.com/matlabcentral/fileexchange/30073-mplot-enhanced-plotting-engine), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!