【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])
相关推荐
闲猫30 分钟前
LangChain / Core components / Models
开发语言·python·langchain
-银雾鸢尾-2 小时前
C#中的索引器
开发语言·c#
Qlittleboy2 小时前
PHP的接口参数传递的过多,max_input_vars = 5000
开发语言·php
Aurorar0rua2 小时前
CS50 x 2024 Notes Algorithms - 02
c语言·开发语言·学习方法
en.en..3 小时前
冒泡排序与选择排序完整对比解析
开发语言·数据结构·算法·c#·排序算法
兰令水3 小时前
hot100【acm版】【2026.7.18打卡-java版本】
java·开发语言·算法
cui_ruicheng3 小时前
Python从入门到实战(十三):模块、包与环境管理
开发语言·python
就叫飞六吧3 小时前
子页面和dialog案例
开发语言·javascript·ecmascript
geovindu3 小时前
CSharp: Decorator Pattern
开发语言·后端·c#·装饰器模式·结构型模式
倒流时光三十年4 小时前
Logback 系列(3):三大核心组件 Logger / Appender / Encoder
java·开发语言·logback