python+matlab text(按图的相对位置显示)

python

用 python 画图时,如果想采用归一化的坐标来指定文本框的位置,则需要用到 transform = ax.transAxes 参数,如

python 复制代码
ax = plt.gca()
plt.text(0.1,0.2, "text", fontsize = 20, transform = ax.transAxes)

matlab

方法1

text(___,Name,Value) 使用一个或多个名称-值对组指定 Text 对象的属性。例如,'FontSize',14 将字体大小设置为 14 磅。您可以使用上述语法中的任意输入参数组合指定文本属性。如果您将 Position 和 String 属性指定为名称-值对组,则不需要指定 x、y、z 和 txt 输入(这种方法是使用键-对值)

bash 复制代码
text( 'string',"(a) UB-OR", 'Units','normalized','position',[0.75,0.95]);  
方法2

% TEXT(X,Y,str,'sc') interprets the (X,Y) points in normalized axis

% coordinates, where (0,0) is the lower-left corner of the current axes,

% and (1,1) is the upper-right.

bash 复制代码
text( 0.75,0.95,"(a) UB-OR", "sc");  
相关推荐
java1234_小锋1 分钟前
【NLP舆情分析】基于python微博舆情分析可视化系统(flask+pandas+echarts) 视频教程 - 热词数量分析日期统计功能实现
python·自然语言处理·flask
山烛17 分钟前
KNN 算法中的各种距离:从原理到应用
人工智能·python·算法·机器学习·knn·k近邻算法·距离公式
guozhetao29 分钟前
【ST表、倍增】P7167 [eJOI 2020] Fountain (Day1)
java·c++·python·算法·leetcode·深度优先·图论
墨染点香35 分钟前
第七章 Pytorch构建模型详解【构建CIFAR10模型结构】
人工智能·pytorch·python
阿什么名字不会重复呢1 小时前
在线工具+网页平台来学习和操作Python与Excel相关技能
python·数据分析
Vertira1 小时前
python 阿里云 安装 dashscope的简介、安装
开发语言·python
gc_22992 小时前
学习Python中Selenium模块的基本用法(1:简介)
python·selenium
先做个垃圾出来………3 小时前
2116. 判断一个括号字符串是否有效
python
兮℡檬,3 小时前
房价预测|Pytorch
人工智能·pytorch·python
青春不败 177-3266-05204 小时前
MATLAB近红外光谱分析技术及实践技术应用
随机森林·机器学习·支持向量机·matlab·卷积神经网络·遗传算法·近红外光谱