Draw rectangle based on data in matlab
问题 I have one row data as follows : 0 -> 2 DATA 1.000000 - 1.000100 SUCCESS 1.000100 - 1.000200 FAIL I want to plot data as below : I think I can use rectangle but it does not show time at x-axis? How to solve this? if SUCCESS it will fill blue color, otherwise red color 回答1: Well you should use the fill command instead of the rectangle command. See my code below to get you started. To tweak things to your liking just consult the help file in MatLab on the functions I am using. Good luck and