列表造折现图
x=1:1:5;%x轴上的数据,第一个值代表数据开始,第二个值代表间隔,第三个值代表终止
a=[203.024,113.857,256.259,244.888,293.376]; %a数据y值
b=[334.4,143.2,297.4,487.2,596.2]; %b数据y值
plot(x,a,'-*b',x,b,'-or'); %线性,颜色,标记
axis([0,6,0,700]) %确定x轴与y轴框图大小
set(gca,'XTick',[0:1:6]) %x轴范围1-6,间隔1
set(gca,'YTick',[0:100:700]) %y轴范围0-700,间隔100
legend('Neo4j','MongoDB'); %右上角标注
xlabel('深度') %x轴坐标描述
ylabel('时间(ms)') %y轴坐标描述
公式造图
F=70;
M=3.6;
m=0.27;
g=9.8;
x=0:0.1:1;
V=((M-m)*sqrt(2*g*(0.4-x))+2*M*(sqrt(2*(F*x-M*g)/M)-sqrt(2*g*(0.4-x))))/m+M;
plot(x,V);
plot(x,V,'or-');
legend('data');
title('力的夹角与速度图像')
xlabel('cos(x)')
ylabel('V(m/s)') ;
列表造图
%abc = [2,4,6,8,10,12,14,16];
%cba = [7.15,7.15,16.375,24.15,30.3,564,2256,10156];
abc = [1,4,8,10,11];
cba = [1,4,100,1000,1000];
% Create the pie chart in position 1 of a 2x2 grid
figure
% Create the line plot in position 4 of a 2x2 grid
subplot(1, 1, 1)
plot(abc,cba,'r-o','MarkerFaceColor','red');
hold on;
% legend('Weekend','Weekday',1)
set(gca,'XTickLabel',{'20000','40000','60000','80000','100000'},'FontSize',15)
% set(gca,'XTick',1:1:7);
xlabel('Average number of requests per hour')
ylabel('Worst-case response time')
% title('Sports activity ')
axis([1 11 0.0 600])
grid on;
set(gcf,'color','white')