%% Test mplot class
clear;
clc;
%% Example 1 - Test all colors
figure;
m = mPlot(); m.isAutoIncrementing = 1; m.setGlobalMarkerSize(8);
for i=1:12
m.plot((1:5)',randn(5,1));
end
axis tight;
title('Example 1 - Test all colors');
%% Example 2 - Test all colors with no auto-incrementing
figure;
m = mPlot(); m.isAutoIncrementing = 0; m.setGlobalMarkerSize(8);
for i=1:5
m.plot((1:5)',randn(5,1));
m.incrementPlotCounter();
end
axis tight;
title('Example 2 - Test all colors with no auto-incrementing');
%% Example 3 - Test hold state increment marker size
figure;
m = mPlot(); m.markerStepSize = 2; m.holdStateIncrementMarkerSizeOn();
m.isAutoIncrementing = 1;
for i=1:5
m.plot((1:5)',randn(5,1));
end
m.incrementPlotCounter();
m.holdStateIncrementMarkerSizeOff(); m.isAutoIncrementing = 1;
for i=1:2
m.plot((1:5)',randn(5,1));
end
title('Example 3 - Test hold state increment marker size');
legend('Model A - c = 1', 'Model A - c = 2', 'Model A - c = 3',...
'Model A - c = 4', 'Model A - c = 5', 'Model B', 'Model C');
%% Example 4 - Test different color schemes
m = mPlot(); m.isAutoIncrementing=1;
subplot(3,2,1); m.setColorSchemeJet(); for i=1:10 m.plot(0:4,rand(5,1)); end; title('Jet');
subplot(3,2,2); m.setColorSchemeHot(); m.resetPlotCounter(); for i=1:10 m.plot(0:4,rand(5,1)); end; title('Hot');
subplot(3,2,3); m.setColorSchemeHSV(); m.resetPlotCounter(); for i=1:10 m.plot(0:4,rand(5,1)); end; title('HSV');
subplot(3,2,4); m.setColorSchemeCool(); m.resetPlotCounter(); for i=1:10 m.plot(0:4,rand(5,1)); end; title('Cool');
subplot(3,2,5); m.setColorSchememPlot(); m.resetPlotCounter(); for i=1:10 m.plot(0:4,rand(5,1)); end; title('mPlot Default');
subplot(3,2,6); m.setColorSchemeLines(); m.resetPlotCounter(); for i=1:10 m.plot(0:4,rand(5,1)); end; title('Lines');