How to add hat in the plot legend?
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a plot where I have to show the legend in the following way:

However, I have already made the plot and there is already a legend in the plot. I can not run the plot code again beacuse I have many plots to recreate. Is there any way that I can chang the legend within the plot itself by using propery inspector, plot browser, etc so that I don't need to run the code again. The legend is already is tex form.
0 Commenti
Risposte (1)
Star Strider
il 4 Mag 2024
Perhaps this —
x = (0:10);
y = rand(11,2);
figure
plot(x, y(:,1), '-g', 'DisplayName','$i_a^{true}$', 'LineWidth',2)
hold on
plot(x, y(:,2), '--b', 'DisplayName','$i_a\ for\ \widehat{r_l}=1.0$', 'LineWidth',2)
hold off
legend('Location','best', 'Interpreter','LaTeX', 'FontSize',14)
For the hat, you can use either \hat to give
or \widehat
to give the result as showin in the legend. (They actually look different in the legend, although not in the previous sentence.)
.
0 Commenti
Vedere anche
Categorie
Scopri di più su Legend in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
