【MATLAB】在图框中加箭头文本注释

1、在图框中加 文本方法 ------ text()函数

2、使用箭头标注------annotation()函数

X、Y是箭头的位置相对于整个方框的比例,

0.32,0.5是指:x坐标从整个图形32%的地方到50%的地方(从左到右)

0.6,0.4是指:y坐标从60%的地方到40%的地方(从上到下)

举例:

Matlab 复制代码
clc;clear;close all;
t=linspace(1,2);
f=t.^2;
g=sin(2*pi*t);
plot(t,f,'k-',t,g,'or');
legend('t^2','sin(2\pit)');
title('Mini assignment');
xlabel('Time(ms)');
ylabel('f(t)');
xticks(1:0.2:2);
str1 ='t^2';
text(1.14,2.1,str1,'Interpreter','latex');
annotation("arrow",'X',[0.3,0.5],'Y',[0.6,0.4])
相关推荐
AI玫瑰助手2 小时前
Python函数:默认参数的定义与注意事项
开发语言·python·信息可视化
油炸自行车3 小时前
Claude Code 错误:API Error: 400 Failed to deserialize the JSON body into the
开发语言·javascript·json·trae·claude code·api error 400
肩上风骋3 小时前
C++14特性
开发语言·c++·c++14特性
JAVA社区4 小时前
Java高级全套教程(十)—— SpringCloudAlibaba超详细实战详解
java·开发语言·spring cloud·面试·职场和发展
弥树子4 小时前
踩坑记录:服务器内网调用接口,真实请求URL与官方公开URL不一致问题排查
开发语言·php
彬鸿科技4 小时前
bhSDR Studio/Matlab入门指南(十一):AI数据集采集实验界面全解析
人工智能·matlab·软件定义无线电
z落落5 小时前
C# ToCharArray + foreach遍历 + String与StringBuilder
开发语言·c#
学代码的真由酱5 小时前
Java多用户一对一网页聊天室-测试报告
java·开发语言·功能测试·测试
人道领域5 小时前
【LeetCode刷题日记】669.修剪二叉搜索树
开发语言·python·算法
xiaoshuaishuai86 小时前
C# AvaloniaUI动态显示图片
开发语言·c#