我正在尝试在绘图中包含一个显示结果的小文本框和表格。在表格中,我想仅更改单个单词或符号的文本颜色。
该表格是使用tabular和LaTeX标记创建的。由于某种原因,来自TextBox Properties的一些命令(如
该表格是使用tabular和LaTeX标记创建的。由于某种原因,来自TextBox Properties的一些命令(如
\it
)有效,而例如\color{red}
则无效。您知道使其变色的方法吗?figure
str = '\begin{tabular}{lr} $\it test$ & A \\ $\color{magenta} test$ & A\end{tabular}';
h = annotation('textbox',[.15 .15 .2 .28],...
'Interpreter', 'latex',...
'FitBoxToText','on',...
'EdgeColor','black',...
'BackgroundColor', [1 1 1]);
set(h, 'String', str);
\color
是来自于xcolor
包。 - Ander Biguri