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");  
相关推荐
老白干43 分钟前
jjwt 0.9.1 在 JDK 11+ 上的两个“坑”与完整解决方案
java·python·log4j
笨鸟先飞,勤能补拙7 小时前
AI 赋能网络安全:技术全景、成熟度评估与实战案例
人工智能·python·安全·web安全·网络安全·sqlite·github
长和信泰光伏储能8 小时前
京津冀光伏发电:绿色能源的未来之路
python·能源
浦信仿真大讲堂8 小时前
从重复操作到自动化闭环:如何让 CST 与 Python 真正协同起来
python·自动化·cst·仿真软件·达索软件
白白白小纯8 小时前
算法篇—反转链表
c语言·数据结构·算法·leetcode
Gu Gu Study9 小时前
ScoutLoop开放域深度研究引擎(agent的初步设计想法)
人工智能·python
卷无止境10 小时前
写代码这件事,到底该讲究点什么?
后端·python
卷无止境10 小时前
循环复杂度到底在算什么,Python 代码怎么才能写得让人一看就懂
后端·python
lpfasd12310 小时前
MediaCrawler 项目深度分析
chrome·python·chrome devtools
Dxy123931021610 小时前
Python项目打包成EXE完整教程(PyInstaller实战避坑)
开发语言·python