labelling issue in graph plotting

1 view (last 30 days)
yogeshwari patel
yogeshwari patel on 21 Dec 2024
Answered: Suraj Kumar on 21 Dec 2024
plot(r,v1_lower,r,v1_upper,'LineWidth',4)
xlabel('r')
ylabel('\widetilde\nu_1(\chi ,\tau ;r )')
%subplot(2,2,2)
plot(r,v2_lower,r,v2_upper,'LineWidth',4)
xlabel('r')
ylabel('\widetilde\nu_2(\chi ,\tau ;r )')
%subplot(2,2,3)
plot(r,v3_lower,r,v3_upper,'LineWidth',4)
xlabel('r')
ylabel('\widetilde\nu_3(\chi ,\tau ;r )')
Due to \widetilde the y axis is not displayed \widetilde\nu_3(\chi ,\tau ;r ) the notation are not displayed

Answers (1)

Suraj Kumar
Suraj Kumar on 21 Dec 2024
I understand the issue that you are encountering here in labeling the y-axis in the MATLAB plots.
The issue is that LaTeX commands like '\widetilde' weren't enclosed in dollar signs ($) and MATLAB wasn't set to interpret labels with LaTeX.
You can refer to the below mentioned code snippet and the attached output for better understanding:
plot(r, v1_lower, r, v1_upper, 'LineWidth', 2);
xlabel('r');
ylabel('$\widetilde{\nu}_1(\chi ,\tau ;r )$', 'Interpreter', 'latex');
title('Plot of $\widetilde{\nu}_1$', 'Interpreter', 'latex');
legend('Lower', 'Upper');
Output:
To learn more about using LaTex to format titles and axis labels, you can refer to the following documentation:
Hope this helps!

Categories

Find more on Labels and Styling in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!