matlab - Rounded corner rectangle coordinate representation -
simple rounded corner rectangle code in matlab can written follows.
rectangle('position',[0,-1.37/2,3.75,1.37],... 'curvature',[1],... 'linewidth',1,'linestyle','-') daspect([1,1,1]) how x , y coordinates arrays of figure?
to axes units boundaries, do:
axisunits = axis(axeshandle) % axeshandle gca axisunits 4 elements array, following syntax: [xlowlim xhighlim ylowlim yhighlim], contain zlow , zhigh 3-d plots.
but think not need know. checking matlab documentation rectangle properties, find:
position four-element vector [x,y,width,height]
location , size of rectangle. specifies location , size of rectangle in data units of axes. point defined x, y specifies 1 corner of rectangle, , width , height define size in units along x- , y-axes respectively.
it documented on rectangle documentation:
rectangle('position',[x,y,w,h]) draws rectangle point x,y , having width of w , height of h. specify values in axes data units.
see if illustrate want. have x axis goes −100 100 , y axis goes 5 15. suppose want put rectangle −30 −20 in x , 8 10 in y.
rectangle('position',[-30,8,10,2]);
Comments
Post a Comment