how can i draw rectangle in gui axes???

10 views (last 30 days)
What wrong with the following???

Accepted Answer

Image Analyst
Image Analyst on 5 Jan 2015
Try specifying the parent axes in advance with axes():
axes(handles.layoutAxes);
rectangle('Position', [X_coordinate(i), Y_coordinate(i), 2, hdend(n, 1)]);

More Answers (1)

Stephen23
Stephen23 on 5 Jan 2015
Edited: Stephen23 on 5 Jan 2015
It appears that the syntax that you use is not supported by the rectangle documentation. The online documentation lists these syntax variations:
rectangle
rectangle('Position',[x,y,w,h])
rectangle('Curvature',[x,y])
rectangle('PropertyName',propertyvalue,...)
h = rectangle(...)
but your code is something like this:
rectangle(h,'Position',[...])
You should read the rectangle properties documentation, particularly the section entitled 'Parent'.

Categories

Find more on Visual Exploration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!