0
votes

I have 2 rows data as follows :

STA0 = 

     '0 -> 2 1.000000 1.000200 A-MPDU 1.000000 1.000100 SUCCESS 1.000100 1.000200 FAIL NO'
     '0 NO NaN 1.000270 1.000570 BACKOFF NaN NaN NO NaN NaN NO NO'

I want to make graph in Matlab like this :

enter image description here

So far I only can make graph when only one row exists thus Backoff rectangle doesn't exist.

enter image description here

How to make these 2 rows can be drawn as graph above ?

1
Please show us what code you have so far. Also, can't you just reuse the same logic, but have a hold on before the next plot call? - rayryeng
I use the code from my previous question here : stackoverflow.com/questions/24904965/… - bnbfreak

1 Answers

0
votes

To draw colored rectangles, check out this Saturn Fiddle.

figure;
hold all;
xlim([0,1]);
ylim([0,1]);
set(gca,'visible','off');
rectangle('Position',[0,0,.5,.5],'FaceColor',[1,0,0]);
rectangle('Position',[.5,.5,.2,.2],'FaceColor',[0,0,1],'EdgeColor',[0,0,0],'Linewidth',4,'Linestyle','--');
print("MyPNG.png", "-dpng")

You can customize the code above for your case.