Differential dot in legend using Tex interpreter
31 次查看(过去 30 天)
显示 更早的评论
Hi!
I would like to put a derivative dot on a letter in my legend.
I did it in a previous code using LaTeX interpeter but now I would like to use Tex interpreter since all the graphs of the work should have the same style.
Do you know I could do it?
Thank you!
0 个评论
采纳的回答
Adam Danz
2021-3-17
编辑:Adam Danz
2021-4-17
To use an overdot as a legend string with TeX interpreter, use a unicode diacritic character (see resources below).
For example, I copied the unicode characters V̇ and Ṫ from the links below and attained its numeric representation in Matlab using,
double('V̇') % Copy-pasted character
double('Ṫ') % Copy-pasted character
Rather than storing those characters in your code, just use the numeric equivilants.
Convert back to char and assign the value to the DisplayName properties of the graphics objects that should appear in the legend. The 2nd line shows how to combine the overdot character with other characters.
hold on
h(1) = plot(0:.1:1, rand(1,11), 'DisplayName', char([86 775]));
h(2) = plot(0:.1:1, rand(1,11), 'DisplayName', ['(' char(7786) 'G)/X']);
lh = legend(h, 'FontSize', 14);
lh.Interpreter
Resources: Overdot characters
更多回答(1 个)
Cris LaPierre
2021-3-17
编辑:Cris LaPierre
2021-3-17
I do not believe \dot is supported by the tex interpreter. You can find a list of the supported Greek letters and special characters here.
3 个评论
Adam Danz
2021-3-17
> I fixed it adding a text with a single dot just above the character
Isn't that exactly what you wanted to do?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!