我创建像这样一个传说,Matlab的 - 乳胶格式间距
theta = [90 120 80 120];
phi = [120 120 180 180];
for i=1:length(theta)
plot_legend{i} = sprintf('\\theta=%3d\\circ\\phi=%3d\\circ',theta(i),phi(i))
end
这让我我想要的输出
plot_legend =
'\theta= 90\circ\phi=120\circ'
'\theta=120\circ\phi=120\circ'
'\theta= 80\circ\phi=180\circ'
'\theta=120\circ\phi=180\circ'
但是当这是由TeX的解释器解释,领先的空间被忽视了,我觉得有点烦人。有没有简单的TeX方法来确保间距保持?
但是当通过图例调用时,间距不被保持。
legend(plot_legend,'interpreter','latex')
'\'(斜杠后面有一个空格)是建立在乳胶空白的一种方式,你也可以尝试'\,',对于一个完整列表,请参阅[上TeX.se这个答案](http://tex.stackexchange.com/a/74354),尽管有些可能不适用于Matlab的LaTeX解释器。 – David 2015-03-25 00:02:37
但我只需要2digt的情况下,而不是3digit的空白? – Ash 2015-03-25 00:31:19
是否要在显示的图例中添加空格?或者在评估'plot_legend'时在命令窗口中? – David 2015-03-25 00:48:32