MATLAB Function Reference (Volume 2: Graphics)
MATLAB Function Reference (Volume 2: Graphics) MATLAB Function Reference (Volume 2: Graphics)
oxPurpose2rbboxCreate rubberband box for area selectionSynopsisDescriptionrbboxrbbox(initialRect)rbbox(initialRect,fixedPoint)rbbox(initialRect,fixedPoint,stepSize)finalRect = rbbox(...)rbbox initializes and tracks a rubberband box in the current figure. It sets theinitial rectangular size of the box to 0, anchors the box at the figure’sCurrentPoint, and begins tracking from this point.rbbox(initialRect) specifies the initial location and size of the rubberbandbox as [x y width height], where x and y define the lower-left corner, andwidth and height define the size. initialRect is in the units specified by thecurrent figure’s Units property, and measured from the lower-left corner of thefigure window. The corner of the box closest to the pointer position follows thepointer until rbbox receives a button-up event.rbbox(initialRect,fixedPoint) specifies the corner of the box that remainsfixed. All arguments are in the units specified by the current figure’s Unitsproperty, and measured from the lower-left corner of the figure window.fixedPoint is a two-element vector, [x y]. The tracking point is the cornerdiametrically opposite the anchored corner defined by fixedPoint.rbbox(initialRect,fixedPoint,stepSize) specifies how frequently therubberband box is updated. When the tracking point exceeds stepSize figureunits, rbbox redraws the rubberband box. The default stepsize is 1.finalRect = rbbox(...) returns a four-element vector, [x y width height],where x and y are the x and y components of the lower-left corner of the box,and width and height are the dimensions of the box.Remarksrbbox is useful for defining and resizing a rectangular region:2-384
ox• For box definition, initialRect is [x y 0 0], where (x,y) is the figure’sCurrentPoint.• For box resizing, initialRect defines the rectangular region that you resize(e.g., a legend). fixedPoint is the corner diametrically opposite the trackingpoint.rbbox returns immediately if a button is not currently pressed. Therefore, youuse rbbox with waitforbuttonpress so that the mouse button is down whenrbbox is called. rbbox returns when you release the mouse button.ExamplesAssuming the current view is view(2), use the current axes’ CurrentPointproperty to determine the extent of the rectangle in dataspace units:k = waitforbuttonpress;point1 = get(gca,'CurrentPoint');finalRect = rbbox;point2 = get(gca,'CurrentPoint');point1 = point1(1,1:2);point2 = point2(1,1:2);p1 = min(point1,point2);offset = abs(point1-point2);% button down detected% return figure units% button up detected% extract x and y% calculate locations% and dimensionsx = [p1(1) p1(1)+offset(1) p1(1)+offset(1) p1(1) p1(1)];y = [p1(2) p1(2) p1(2)+offset(2) p1(2)+offset(2) p1(2)];hold onaxis manualplot(x,y)% redraw in dataspace unitsSee Alsoaxis, dragrect, waitforbuttonpress2-385
- Page 363 and 364: Patch Properties• An n-by-1 matri
- Page 365 and 366: Patch Propertiesprotect GUIs from c
- Page 367 and 368: Patch PropertiesMarker Specifierd^v
- Page 369 and 370: Patch PropertiesYou can also set th
- Page 371 and 372: pbaspectPurpose2pbaspectSet or quer
- Page 373 and 374: pbaspectIt is also interesting to l
- Page 375 and 376: pbaspect0.50−0.520−2−2020.50
- Page 377 and 378: pcolorExamplesA Hadamard matrix has
- Page 379 and 380: peaksPurpose2peaksA sample function
- Page 381 and 382: pieExamplesEmphasize the second sli
- Page 383 and 384: plotPurpose2plotLinear 2-D plotSynt
- Page 385 and 386: plotproduce this graph.3210−1−2
- Page 387 and 388: plot1Plot of sin(Θ)0.80.60.40.2sin
- Page 389 and 390: plot33530252015105010.510−0.5−1
- Page 391 and 392: plotmatrix50−51050−51050−5−
- Page 393 and 394: plotyy10.500−10 1 2 3 4 5 6 7 −
- Page 395 and 396: polarSee Alsocart2pol, compass, Lin
- Page 397 and 398: print, printoptpcmd and dev are pla
- Page 399 and 400: print, printoptDevice-dcdj550-dpain
- Page 401 and 402: print, printoptOption-rnumber-adobe
- Page 403 and 404: print, printoptTroubleshooting MS-W
- Page 405 and 406: print, printoptNotes on Printing In
- Page 407 and 408: printdlgPurpose2printdlgDisplay pri
- Page 409 and 410: questdlgExampleCreate a question di
- Page 411 and 412: quiverExamples Plot the gradient fi
- Page 413: quiver3Examples Plot the surface no
- Page 417 and 418: ectanglevertical curvature can be d
- Page 419 and 420: ectangleThis example creates an ell
- Page 421 and 422: ectangleProperty Name Property Desc
- Page 423 and 424: ectangle propertiesRectanglePropert
- Page 425 and 426: ectangle propertiesEraseMode{normal
- Page 427 and 428: ectangle propertiesHitTest{on} | of
- Page 429 and 430: ectangle propertiesVisible{on} | of
- Page 431 and 432: educepatchThe number of output tria
- Page 433 and 434: educevolumePurpose2reducevolumeRedu
- Page 435 and 436: educevolumeSee Alsoisosurface, isoc
- Page 437 and 438: esetPurpose2resetReset graphics obj
- Page 439 and 440: gbplotPurpose2rgbplotPlot colormapS
- Page 441 and 442: ibbonExamplesCreate a ribbon plot o
- Page 443 and 444: oot objectProperty Name Property De
- Page 445 and 446: oot objectProperty Name Property De
- Page 447 and 448: Root Propertieswhich does not resta
- Page 449 and 450: Root PropertiesLanguagestringSystem
- Page 451 and 452: Root PropertiesShowHiddenHandleson
- Page 453 and 454: osePurpose2roseAngle histogramSynta
- Page 455 and 456: otatePurpose2rotateRotate object ab
- Page 457 and 458: otate3dPurpose2rotate3dRotate axes
- Page 459 and 460: scatter−47.95−48−48.05−48.1
- Page 461 and 462: scatter3Examples[x,y,z] = sphere(16
- Page 463 and 464: semilogx, semilogyPurpose2semilogx,
oxPurpose2rbboxCreate rubberband box for area selectionSynopsisDescriptionrbboxrbbox(initialRect)rbbox(initialRect,fixedPoint)rbbox(initialRect,fixedPoint,stepSize)finalRect = rbbox(...)rbbox initializes and tracks a rubberband box in the current figure. It sets theinitial rectangular size of the box to 0, anchors the box at the figure’sCurrentPoint, and begins tracking from this point.rbbox(initialRect) specifies the initial location and size of the rubberbandbox as [x y width height], where x and y define the lower-left corner, andwidth and height define the size. initialRect is in the units specified by thecurrent figure’s Units property, and measured from the lower-left corner of thefigure window. The corner of the box closest to the pointer position follows thepointer until rbbox receives a button-up event.rbbox(initialRect,fixedPoint) specifies the corner of the box that remainsfixed. All arguments are in the units specified by the current figure’s Unitsproperty, and measured from the lower-left corner of the figure window.fixedPoint is a two-element vector, [x y]. The tracking point is the cornerdiametrically opposite the anchored corner defined by fixedPoint.rbbox(initialRect,fixedPoint,stepSize) specifies how frequently therubberband box is updated. When the tracking point exceeds stepSize figureunits, rbbox redraws the rubberband box. The default stepsize is 1.finalRect = rbbox(...) returns a four-element vector, [x y width height],where x and y are the x and y components of the lower-left corner of the box,and width and height are the dimensions of the box.Remarksrbbox is useful for defining and resizing a rectangular region:2-384