Line or bar over the y-axis variable in x-y plot
6 views (last 30 days)
Show older comments
Dr. Sandeep Soni
on 17 Apr 2016
Commented: Star Strider
on 17 Apr 2016
(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
0 Comments
Accepted Answer
Star Strider
on 17 Apr 2016
Edited: Star Strider
on 17 Apr 2016
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')
2 Comments
More Answers (0)
See Also
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!