plotting line parallel to the x-axis instead of the y-axis
5 views (last 30 days)
Show older comments
Hi Folks,
i have the following code.
int = A{:,4};
wl = A{:,1};
plot(wl-0.01,0,'b',wl,int,'b',wl+0.01,0,'b')
it reads in numbers from an imported excel sheet and plots it.
the numbers are read as double with 3 decimal places. i am adding 0 either side of the values to be adjusted at a later date.
the plotted line starts from the bottom of the y axis=0 and plots going up i.e. it plots going up. i want it to start at the x=0 point and plot the line going away in the x+ direction instead of the y+ direction. Any ideas how to do this?
Thanks,
Dave
0 Comments
Answers (1)
randerss simil
on 10 Feb 2021
%if
plot([wl-0.01,0],intt,'b',wl,intt,'b',[wl+0.01,0],intt,'b')
Use [] for adding elements and int is standard function in matlab. So i changed it to something like intt
0 Comments
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!