Place text between vertical lines on graph

2 ビュー (過去 30 日間)
matlabuser12
matlabuser12 2014 年 10 月 13 日
回答済み: matlabuser12 2014 年 10 月 13 日
I have several lines on my graph made like so:
if true
line([Task1 Task1],[0 500],'Color',[0 0 0], 'LineStyle','--');
line([Task2 Task2],[0 500],'Color',[0 0 0], 'LineStyle','--');
line([Task3 Task3],[0 500],'Color',[0 0 0], 'LineStyle','--');
line([Task4 Task4],[0 500],'Color',[0 0 0], 'LineStyle','--');
line([Task5 Task5],[0 500],'Color',[0 0 0], 'LineStyle','--');
line([Task6 Task6],[0 500],'Color',[0 0 0], 'LineStyle','--');
line([Task7 Task7],[0 500],'Color',[0 0 0], 'LineStyle','--');
end
For each task that is occurring and then I have labels on those lines made out like so:
if true
text(Task1, 500, ' That happened','rotation',90);
text(Task2,500,' This happened','rotation',90);
end
I can only figure out how to label the lines directly on the line at the task value. all the task values are random, so the spacing between them and thus the vertical lines is as well. Simply dividing the task value by 2 does not work. Is there some way to do this I am not realizing?
  1 件のコメント
matlabuser12
matlabuser12 2014 年 10 月 13 日
never mind i am retarded and can just do (task1+task2)/2 to place it between all my tasks...

サインインしてコメントする。

採用された回答

matlabuser12
matlabuser12 2014 年 10 月 13 日
never mind i am retarded and can just do (task1+task2)/2 to place it between all my tasks...

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by