Trying to get symbols to display a formula in title of uiaxes bar plot
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Govind Sankar Madhavan Pillai Ramachandran Nair
el 26 de Jun. de 2025
Respondida: Govind Sankar Madhavan Pillai Ramachandran Nair
el 26 de Jun. de 2025
I am trying to get symbols to display a formula in title of uiaxes bar plot. In the beginning it was like this. I enter this code :
app.UIAxes_4.Title.String = 'Sigma of each cell, $$\sigma = \sqrt{1/N*\Sigma_N(E-R_{ref})^2}$$'
and then I got this.

This is correct. But I want to add this along with it

This is from another normal plot and i generated this by using the code :
titl1 ='best \sigma = ';
titl2 = num2str(app.bestSigma);
titl3 = ' worst \sigma= ';
titl4 = num2str(app.worstSigma);
titl = strcat(titl1,titl2,titl3,titl4);
app.UIAxes_3.Title.String = titl;
And now I try to combine this :
titl1 ='Sigma of each cell, $$\sigma = \sqrt{1/N*\Sigma_N(E-R_{ref})^2}$$, best \sigma = ';
titl2 = num2str(app.bestSigma);
titl3 = ' worst \sigma= ';
titl4 = num2str(app.worstSigma);
titl = strcat(titl1,titl2,titl3,titl4);
app.UIAxes_4.Title.String = titl;
But I end up getting this :

I even tried this :
app.UIAxes_4.Title.String = "Sigma of each cell, $$\sigma = \sqrt{1/N*\Sigma_N(E-R_{ref})^2}$$, best \sigma = " + num2str(app.bestSigma) + " worst \sigma= " + num2str(app.worstSigma);
and still ended up getting the same wrong answer.
So how can I combine the first two images to get the solutioin for a title in an UIaxes bar plot. Thank you.
1 comentario
Epsilon
el 26 de Jun. de 2025
Editada: Epsilon
el 26 de Jun. de 2025
Try:
titl = sprintf(['Sigma of each cell, $$\\sigma = \\sqrt{\\frac{1}{N}\\sum_N(E-R_{ref})^2}$$, ', ...
'best $\\sigma = %.3f$, worst $\\sigma = %.3f$'], ...
app.bestSigma, app.worstSigma);
app.UIAxes_4.Title.String = titl;
app.UIAxes_4.Title.Interpreter = 'latex';
Respuestas (1)
Ver también
Categorías
Más información sobre Title en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!