matlab中 text 使用画图示例

来源:互联网 发布:办公软件教学计划 编辑:程序博客网 时间:2024/06/03 04:22
% Plot the image of the Sensitivity and False Positive per imageclear;close all;clc;I1 =[0.5 75];I2 =[1 54.5];msize =19; %设定字体的大小 hold on  plot(I1(1),I1(2),'ko-','MarkerFaceColor','r')  % 红色实心圆点 text(I1(1)+0.1,I1(2),'Wei 2002')hold on plot(I2(1),I2(2),'ko-','MarkerFaceColor','g')  % 绿色实心圆点text(I2(1)+0.1,I2(2),'Carreira 1998','fontsize',msize)hold on legend('Wei 2002','Carreira 1998')axis on;axis tightgrid onaxis([0 8 0 100]);ylabel('Sensitivity')xlabel('False Positivies per image')% 用set设定绘图坐标的FontSize属性,这种设定同时对坐标轴标注、图例、标题有效h = gca;set(h,'FontSize',msize);% 设置文字大小,同时影响坐标轴标注、图例、标题等% x=0:0.2:12;%       plot(x,sin(x),'-',x,1.5*cos(x),':')%       legend('First','Second',-1);    %强行将注释视窗放在图形视窗的外右边。

效果图如下

这里写图片描述

0 0