How do i plot a line at a single desired point on the X-Axis?
3 次查看(过去 30 天)
显示 更早的评论
I have a data i.e. x=[1:10]; y=[23 24 29 45 32 23 67 45 89 31]; and i want to draw a line on the x-axis at point 6 of x-axis. How can i do that? Thanks, Parth
1 个评论
Walter Roberson
2016-4-10
Where should the line start? Where should it end? Is it a horizontal line or a vertical line?
回答(1 个)
Kuifeng
2016-4-10
%at point x0 = 6, vertical line
x0 = 6;
plot([x0 x0], [min(y), max(y)], 'r-');
%revise the y values to your desired values
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!