How do i plot a line at a single desired point on the X-Axis?

1 回表示 (過去 30 日間)
Parth Sarathi
Parth Sarathi 2016 年 4 月 10 日
回答済み: Kuifeng 2016 年 4 月 10 日
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
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
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

カテゴリ

Help Center および File ExchangeDescriptive Statistics and Visualization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by