MATLAB Function Reference (Volume 2: Graphics)
MATLAB Function Reference (Volume 2: Graphics) MATLAB Function Reference (Volume 2: Graphics)
axesExamplesZoomingZoom in using aspect ratio and limits:sphereset(gca,'DataAspectRatio',[1 1 1],...'PlotBoxAspectRatio',[1 1 1],'ZLim',[−0.6 0.6])Zoom in and out using the CameraViewAngle:sphereset(gca,'CameraViewAngle',get(gca,'CameraViewAngle')−5)set(gca,'CameraViewAngle',get(gca,'CameraViewAngle')+5)Note that both examples disable MATLAB’s stretch-to-fill behavior.Positioning the AxesThe axes Position property enables you to define the location of the axeswithin the figure window. For example,h = axes('Position',position_rectangle)creates an axes object at the specified position within the current figure andreturns a handle to it. Specify the location and size of the axes with a rectangledefined by a four-element vector,position_rectangle = [left, bottom, width, height];The left and bottom elements of this vector define the distance from thelower-left corner of the figure to the lower-left corner of the rectangle. Thewidth and height elements define the dimensions of the rectangle. You specifythese values in units determined by the Units property. By default, MATLABuses normalized units where (0,0) is the lower-left corner and (1.0,1.0) is theupper-right corner of the figure window.You can define multiple axes in a single figure window:axes('position',[.1 .1 .8 .6])mesh(peaks(20));axes('position',[.1 .7 .8 .2])pcolor([1:10;1:10]);2-6
axesIn this example, the first plot occupies the bottom two-thirds of the figure, andthe second occupies the top third.21.511 2 3 4 5 6 7 8 9 101050−5−102015105005101520See Alsoaxis, cla, clf, figure, gca, grid, subplot, title, xlabel, ylabel, zlabel,viewObjectHierarchy2-7
- Page 1 and 2: MATLAB®The Language of Technical C
- Page 3 and 4: Contents1Command SummaryGeneral Pur
- Page 5 and 6: 1Command SummaryThis chapter lists
- Page 7 and 8: Controlling the Command Windowclcec
- Page 9 and 10: evalinfevalfunctionglobalnargchkper
- Page 11 and 12: InfInfinityinputname Input argument
- Page 13 and 14: ealremroundsec, sechsignsin, sinhsq
- Page 15 and 16: funmlogmsqrtmEvaluate functions of
- Page 17 and 18: Polynomial and Interpolation Functi
- Page 19 and 20: Sparse Systems of Linear Equationsb
- Page 21 and 22: hex2dechex2numIEEE hexadecimal to d
- Page 23 and 24: Multidimensional Array Functionscat
- Page 25 and 26: stream3streamlinesurf2patchsubvolum
- Page 27 and 28: colormapgraymonhsv2rgbrgb2hsvrgbplo
- Page 29 and 30: Interactive User Inputginput Graphi
- Page 31 and 32: 2ReferenceThis chapter describes al
- Page 33 and 34: areaExamplesPlot the values in Y as
- Page 35: axesWhile the basic purpose of an a
- Page 39 and 40: axesProperty Name Property Descript
- Page 41 and 42: axesProperty Name Property Descript
- Page 43 and 44: axesProperty Name Property Descript
- Page 45 and 46: axesProperty Name Property Descript
- Page 47 and 48: Axes Propertiesgraphics object disp
- Page 49 and 50: Axes PropertiesCameraViewAngleCamer
- Page 51 and 52: Axes PropertiesCurrentPoint 2-by-3
- Page 53 and 54: Axes Propertiesautomatically sets t
- Page 55 and 56: Axes Propertiessetting the XLabel,
- Page 57 and 58: Axes Propertiessets LineStyleOrder
- Page 59 and 60: Axes Propertiesaxes are made as lar
- Page 61 and 62: Axes PropertiesTypestring (read onl
- Page 63 and 64: Axes PropertiesXLabel, YLabel, ZLab
- Page 65 and 66: axisPurpose2axisAxis scaling and ap
- Page 67 and 68: axisaxis normal automatically adjus
- Page 69 and 70: axisThe right figure shows a more s
- Page 71 and 72: ar, barhPurpose2bar, barhBar chartS
- Page 73 and 74: ar, barhExamplesPlot a bell shaped
- Page 75 and 76: ar3, bar3hPurpose2bar3, bar3hThree-
- Page 77 and 78: ar3, bar3hsubplot(3,2,4)bar3(Y,0.5,
- Page 79 and 80: oxPurpose2boxControl axes borderSyn
- Page 81 and 82: camdollyPurpose2camdollyMove the ca
- Page 83 and 84: camlightPurpose2camlightCreate or m
- Page 85 and 86: camlookatPurpose2camlookatPosition
axesExamplesZoomingZoom in using aspect ratio and limits:sphereset(gca,'DataAspectRatio',[1 1 1],...'PlotBoxAspectRatio',[1 1 1],'ZLim',[−0.6 0.6])Zoom in and out using the CameraViewAngle:sphereset(gca,'CameraViewAngle',get(gca,'CameraViewAngle')−5)set(gca,'CameraViewAngle',get(gca,'CameraViewAngle')+5)Note that both examples disable <strong>MATLAB</strong>’s stretch-to-fill behavior.Positioning the AxesThe axes Position property enables you to define the location of the axeswithin the figure window. For example,h = axes('Position',position_rectangle)creates an axes object at the specified position within the current figure andreturns a handle to it. Specify the location and size of the axes with a rectangledefined by a four-element vector,position_rectangle = [left, bottom, width, height];The left and bottom elements of this vector define the distance from thelower-left corner of the figure to the lower-left corner of the rectangle. Thewidth and height elements define the dimensions of the rectangle. You specifythese values in units determined by the Units property. By default, <strong>MATLAB</strong>uses normalized units where (0,0) is the lower-left corner and (1.0,1.0) is theupper-right corner of the figure window.You can define multiple axes in a single figure window:axes('position',[.1 .1 .8 .6])mesh(peaks(20));axes('position',[.1 .7 .8 .2])pcolor([1:10;1:10]);2-6