MATLAB: How to put a hat on letters in a legend hatlegendtext; Hey everyone, I am trying to create a legend for one of my graphs that contains two entries: p and p^^CS – I want a hat on the p and I also want CS in the index…. Can someone tell me how to do that?? Thanks a lot! Best Answer You should use the LaTeX interpreter:legend({'$\hat{p}^{CS}$'},'Interpreter','latex') Related SolutionsMATLAB: How to make Greek letters with Latex interpreter Here is an example:text('Interpreter','latex','String','$$\hat{\beta}$$','Position',[.5 .5],'FontSize',16)or for xlabels:xlabel('$$\hat{\alpha}$$','Interpreter','latex','FontSize',16) MATLAB: Is it possible to interpret legends differently Yes, when you create a legend either set 'Interpreter' when you create it or usehLegend = legend(...)to keep a handle to your legend, then you can change it afterwards as e.g.hLegend.Interpreter = 'none'; Related QuestionHow to move the scientific notation block so that it does not interfere with the title in MATLAB 7.4 (R2007a)[GIS] Google Earth Engine – remove layer from the layer managerWarning: Unable to interpret TeX string
Best Answer