how to shift a subscript upwards in Matlab plot legend?

조회 수: 7 (최근 30일)
Amro Alsabbagh
Amro Alsabbagh 2022년 6월 20일
댓글: Jan 2023년 3월 5일
I have "V_c" in the legend of a figure. However, the subcript "c" is far from "V". Could you please guide me how to make "c" closer to "V", in other words shift it up a little as below?
  댓글 수: 2
Thomas Alberts
Thomas Alberts 2023년 3월 4일
Why doesn't this work in Bode plots:
legend('$Bandpass$','$Highpass$','$Lowpass$','$f_{l}$','$f_{h}$','$f_{m}$', ...
'Interpreter', 'latex')
Jan
Jan 2023년 3월 5일
@Thomas Alberts: Please do not attach a new question as comment to a similar question. Create a new thread instead.
Provide a minimal working example and mention the Matlab version there. This is working as expected for me under R2018b:
plot(1:10, rand(6, 10))
legend('$Bandpass$','$Highpass$','$Lowpass$','$f_{l}$','$f_{h}$','$f_{m}$', ...
'Interpreter', 'latex')

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2022년 6월 20일
편집: Jan 2022년 6월 20일
plot(1:10)
legend('$V_c$', 'Interpreter', 'latex', 'FontSize', 15)
figure
plot(1:10)
legend('$V_{\raisebox{1ex}{c}}$', 'Interpreter', 'latex', 'FontSize', 15)
  댓글 수: 1
Amro Alsabbagh
Amro Alsabbagh 2022년 6월 20일
Thank you verym much. Could you please guide me how to allign the frame of legend to be on the frame of the plot (i.e., edges on edges)?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by