我想要一些参数值出现在我的图片(subplot(3,2,1))中白框的位置.如果解释title()可能是乳胶,就像其他人一样,那将是理想的.
我尝试过以下方法:
title( sprintf( ' $\delta$ = %s $\rho$ = %s $\xi$ = %s m = %s', delta, rho, xi, m), 'Interpreter', 'latex')
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
Warning: Control Character '\d' is not valid. See 'doc sprintf' for control characters valid in the format string.
> In SIXY_sol (line 21)
Warning: Error updating Text.
String must have valid interpreter syntax:
$
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?

这不是使用LaTeX解释器的问题,而是使用您使用的方式sprintf.在文档中sprintf,向下滚动到格式化操作符之前或之后的文本部分.在这里,您将看到该\字符用于开始转义序列,以便您可以执行\n新行等操作.您实际上希望\出现在字符串中,因此您需要转义转义字符.从文档该表需要更换所有的\用\\.
尝试:
title( sprintf( ' $\\delta$ = %s $\\rho$ = %s $\\xi$ = %s m = %s', delta, rho, xi, m), 'Interpreter', 'latex')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2458 次 |
| 最近记录: |