MATLAB Examples

Graph code to Publish papers

Contents

%%basic initialization
clc
clear
close all
warning off all

set output methods

  1. Save fig
  2. Show title on figure
  3. Legend position
save=0;
titleshow=1;
legendpos=0;

demo plot

n=6;
x =1:n;
Y=[87 88 90 91 93 94;90 92 93 94 95 96];
algn = {'Fuzzy ','Enhanced Fuzzy '};
titlen='Precision';
xl='Number of records';
yl=titlen;
xval={'','500','1000','1500','2000','2500','3000',''};
xa=[0,n+1];
ya=[85,100];
saveAsName='1';
graph.plot(x,Y,algn,titlen,xl,yl,xval,xa,ya,titleshow,legendpos,save,saveAsName)

demo bar

legendpos=1;
%
% Y=[87 88 90 91 93 94;90 92 93 94 95 96];
% algn = {'Fuzzy ','Enhanced Fuzzy '};
% titlen='Precision';
% xl='Number of records';
% yl=titlen;
% xval={'','500','1000','1500','2000','2500','3000',''};
n=size(Y,2);
xa=[1,n+2];
% ya=[85,100];
saveAsName='2';
graph.bar(Y,algn,titlen,xl,yl,xval,xa,ya,titleshow,legendpos,save,saveAsName)