how to make subscripts in plot labeling
조회 수: 12 (최근 30일)
이전 댓글 표시
Hello
I have a plot as shown below. However i wantet to make the x and y labeling in subscript
forexample in the x and y label 1 next to K should be subscripted
Thank you for your help
댓글 수: 0
답변 (1개)
Jaswanth
2024년 8월 2일
Hi,
You can use Tex Markup defined in Label Properties to add superscripts and subscripts in MATLAB to include special characters in the text. To create subscript, you can use _{ } modifier.
Please refer to the following example code demonstrating the implementation discussed above:
% Example data
x = 0:0.1:10;
y = sin(x);
% Create a plot
figure;
plot(x, y);
% Add labels with subscripts
xlabel('x_{label}');
ylabel('y_{label}');
Kindly refer to following MathWorks documentation to know more about Tex Markup in Label Properties discussed above: https://www.mathworks.com/help/matlab/ref/matlab.ui.control.label-properties.html?searchHighlight=label%20subscript&s_tid=srchtitle_support_results_4_label%20subscript#:~:text=of%20HTML%20markup.-,TeX%20Markup,-Use%20TeX%20markup
I hope the solution provided above is helpful.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!