Horizontal line in plot up to a graph
1 回表示 (過去 30 日間)
古いコメントを表示
How can I generate a horizontal line starting at x = 0 up to a graph (see figure, red line)? The x, y coordinates are of course available for the graph.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/532309/image.png)
0 件のコメント
回答 (1 件)
KSSV
2021 年 2 月 26 日
If you have the xlimits (x0,x1) and the y-value..the required equations is y = k.
x = 1:10 ;
k = 3 ;
y = k*ones(*Size(x)) ;
plot(x,y)
Also have a look on line.
参考
カテゴリ
Help Center および File Exchange で Discrete Data Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!