figure - sample plot with legend one of the primary goals of matplotlib is to provide publication quality visualizations matplotlib supports latex style formatting of the legends to cleanly visualize mathematical symbols and equations the symbol is used to mark the start and end of latex style formatting the same is shown in the following snippet and output plot (see figure - legend with latex formatting plt plot( , ,' ',label='$ ^ $'plt plot( , ,' :',linewidth= ,label='$ ^ $'plt legend(loc="best",fontsize=' -large'plt title('legend with $latexformatting'figure - sample plot with latex formatted legend