Line or bar over the y-axis variable in x-y plot

6 次查看(过去 30 天)
(1.) Hi everyone, I want to put bar/line over the y –axis variable (Load Capacity ‘W’ ) because that variable is non-dimensional like (W ̅ ). So it will looking like W ̅ . I am using following plot command-
ep1 =[0.0 0.10 0.20 0.30 0.40];
W =[0.0 0.12 0.24 0.36 0.48];
h = plot(ep1,W,'--r')
set(h(1),'linewidth',2.5);
xlabel('Eccen.Ratio, \epsilon','Fontsize',10)
ylabel('Load Capacity, W','Fontsize',10)
How to write the plot command in above MATLAB Prog. for putting the bar above or over the y- axis variable? Kindly help me in this regard. Thanks, SANDEEP SONI, Surat, India; E-mail ID - sandytit2004@gmail.com

采纳的回答

Star Strider
Star Strider 2016-4-17
编辑:Star Strider 2016-4-17
To put a bar over your variable, you have to specify the interpeter as 'latex' and then use the appropriate LaTeX commands in the string in your ylabel call.
It’s not easy to see, but it’s there:
ep1 =[0.0 0.10 0.20 0.30 0.40];
W =[0.0 0.12 0.24 0.36 0.48];
h = plot(ep1,W,'--r');
set(h(1),'linewidth',2.5);
xlabel('Eccen.Ratio, \epsilon','Fontsize',10)
ylabel('Load Capacity, $\bar{W}$','Fontsize',10, 'Interpreter','latex')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by