Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/339.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python matplotlib传说中的希腊语nu(Tex)_Python_Matplotlib_Latex_Legend - Fatal编程技术网

Python matplotlib传说中的希腊语nu(Tex)

Python matplotlib传说中的希腊语nu(Tex),python,matplotlib,latex,legend,Python,Matplotlib,Latex,Legend,我正在使用matplotlib.pyplot打印,并尝试在打印标签中使用Tex\nu字母。 但是,使用label='$B\nu(\nu,T)$',我在绘图图例中得到linebreak+u,因为\n被解释为新行。我还尝试了label='$B_{\nu}({\nu},T)$',它们在输出中给出了相同的结果加上{}。如何让nu在图例中工作?这应该可以: label='$B_\\nu(\\nu, T)$' 退出反斜杠->更改\到\\当然!谢谢,太简单了;)通过将其设置为原始字符串也会起作用(字符串前面

我正在使用matplotlib.pyplot打印,并尝试在打印标签中使用Tex\nu字母。 但是,使用
label='$B\nu(\nu,T)$'
,我在绘图图例中得到linebreak+u,因为\n被解释为新行。我还尝试了
label='$B_{\nu}({\nu},T)$'
,它们在输出中给出了相同的结果加上{}。如何让nu在图例中工作?

这应该可以:

label='$B_\\nu(\\nu, T)$'

退出反斜杠->更改\到\\当然!谢谢,太简单了;)通过将其设置为原始字符串也会起作用(字符串前面的r)
label=r'$B\nu(\nu,T)$
添加说明更改/修改了什么。请不要只发布代码作为答案,还要解释代码的作用以及它是如何解决问题的。带有解释的答案通常更有帮助,质量更好,更容易吸引选票