I want to show direction for specific cells in a figure that I am reading from a matrix.
In the attached figure, I could create the left direction arrow, but I am not getting how to insert a diagonal arrow in the south west direction.
Apparently, latex arrow symbol works fine for left arrow, right arrow, up arrow and down arrow, but fails for diagonal arrows.
In the attached image I need to insert arrows in south west direction through cyan cells. How to do this?
Here is the script I am trying,
for row=1:size(data,1)
for col=1:size(data,2);
if data(row,col)==1
rectangle('Position',[col-0.5 row 1 1], 'FaceColor','y','EdgeColor','k', 'LineWidth', 0.1)
text(col-0.95,row+0.6,'\leftarrow', 'fontsize', 6);
elseif data(row,col)==2
rectangle('Position',[col-0.5 row 1 1], 'FaceColor','c','EdgeColor','k', 'LineWidth', 0.1)
text(col-0.95,row+0.6,'\swarrow', 'fontsize', 6);
else
rectangle('Position',[col-0.5 row 1 1], 'FaceColor','w','EdgeColor','k', 'LineWidth', 0.1)
end
end
set(gca,'Visible','off')
end
Edit:
Annotation
option will increase the complexities and requires positioning of arrows for every another problem. If one could use latex arrow symbol the problem would become way more easier.