MATLAB Function Reference (Volume 2: Graphics)
MATLAB Function Reference (Volume 2: Graphics) MATLAB Function Reference (Volume 2: Graphics)
histPurpose2histHistogram plotSyntaxDescriptionn = hist(Y)n = hist(Y,x)n = hist(Y,nbins)[n,xout] = hist(...)A histogram shows the distribution of data values.n = hist(Y) bins the elements in Y into 10 equally spaced containers andreturns the number of elements in each container. If Y is a matrix, hist worksdown the columns.n = hist(Y,x) where x is a vector, returns the distribution of Y amonglength(x) bins with centers specified by x. For example, if x is a 5-elementvector, hist distributes the elements of Y into five bins centered on the x-axisat the elements in x. Note: use histc if it is more natural to specify bin edgesinstead of centers.n = hist(Y,nbins) where nbins is a scalar, uses nbins number of bins.[n,xout] = hist(...) returns vectors n and xout containing the frequencycounts and the bin locations. You can use bar(xout,n) to plot the histogram.hist(...) without output arguments, hist produces a histogram plot of theoutput described above. hist distributes the bins along the x-axis between theminimum and maximum values of Y.RemarksAll elements in vector Y or in one column of matrix Y are grouped according totheir numeric range. Each group is shown as one bin.The histogram’s x-axis reflects the range of values in Y. The histogram’s y-axisshows the number of elements that fall within the groups; therefore, the y-axisranges from 0 to the greatest number of elements deposited in any bin.The histogram is created with a patch graphics object. If you want to changethe color of the graph, you can set patch properties. See the “Example” sectionfor more information. By default, the graph color is controlled by the currentcolormap, which maps the bin color to the first color in the colormap.2-222
histExamplesGenerate a bell-curve histogram from Gaussian data.x = –2.9:0.1:2.9;y = randn(10000,1);hist(y,x)400350300250200150100500−3 −2 −1 0 1 2 32-223
- Page 201 and 202: Figure PropertiesIf a figure contai
- Page 203 and 204: Figure Propertiescontains colors th
- Page 205 and 206: Figure PropertiesYou can set the ro
- Page 207 and 208: Figure PropertiesTo ensure MATLAB u
- Page 209 and 210: Figure PropertiesProperty ValueA4A5
- Page 211 and 212: Figure PropertiesPointerShapeHotSpo
- Page 213 and 214: Figure PropertiesThere is also a Si
- Page 215 and 216: Figure PropertiesResize{on} | offWi
- Page 217 and 218: Figure Propertiesclick. See uicontr
- Page 219 and 220: Figure PropertiesWindowButtonDownFc
- Page 221 and 222: Figure PropertiesThe information re
- Page 223 and 224: fillIf C is a row vector, fill gene
- Page 225 and 226: fill3If you specify color using C,
- Page 227 and 228: findfigsPurpose2findfigsFind visibl
- Page 229 and 230: findobjSee Alsocopyobj, gcf, gca, g
- Page 231 and 232: fplotExamples Plot the hyperbolic t
- Page 233 and 234: frame2imPurpose2frame2imConvert mov
- Page 235 and 236: gcboPurpose2gcboReturn the handle o
- Page 237 and 238: gcoPurpose2gcoReturn handle of curr
- Page 239 and 240: geta = get(h,'Default') returns all
- Page 241 and 242: getframeMATLAB and that can take ad
- Page 243 and 244: ginputPurpose2ginputInput data usin
- Page 245 and 246: gplotExamplesTo draw half of a Buck
- Page 247 and 248: gridPurpose2gridGrid lines for two-
- Page 249 and 250: helpdlgPurpose2helpdlgCreate a help
- Page 251: hiddenPurpose2hiddenRemove hidden l
- Page 255 and 256: holdPurpose2holdHold current graph
- Page 257 and 258: im2framePurpose2im2frameConvert ind
- Page 259 and 260: imageimage(x,y,C,'PropertyName',Pro
- Page 261 and 262: imageWhen you write an indexed imag
- Page 263 and 264: imageProperty Name Property Descrip
- Page 265 and 266: Image PropertiesImageProperties2Ima
- Page 267 and 268: Image Propertiesproduces:0.511.522.
- Page 269 and 270: Image Properties• xor - Draw and
- Page 271 and 272: Image Propertiesdefine the ButtonDo
- Page 273 and 274: imagescPurpose2imagescScale data an
- Page 275 and 276: imagescSee Alsoimage, colorbar2-245
- Page 277 and 278: inputdlgPurpose2inputdlgCreate inpu
- Page 279 and 280: ishandlePurpose2ishandleDetermines
- Page 281 and 282: isocapsPurpose2isocapsCompute isosu
- Page 283 and 284: isonormalsPurpose2isonormalsCompute
- Page 285 and 286: isosurfacePurpose2isosurfaceExtract
- Page 287 and 288: isosurfaceSee Alsoisonormals, isoca
- Page 289 and 290: legendlegend_handle = legend return
- Page 291 and 292: lightPurpose2lightCreate a light ob
- Page 293 and 294: lightProperty Name Property Descrip
- Page 295 and 296: Light PropertiesLightProperties2Lig
- Page 297 and 298: Light PropertiesWhen a handle’s v
- Page 299 and 300: lightanglePurpose2lightangleCreate
- Page 301 and 302: linePurpose2lineCreate line objectS
histPurpose2histHistogram plotSyntaxDescriptionn = hist(Y)n = hist(Y,x)n = hist(Y,nbins)[n,xout] = hist(...)A histogram shows the distribution of data values.n = hist(Y) bins the elements in Y into 10 equally spaced containers andreturns the number of elements in each container. If Y is a matrix, hist worksdown the columns.n = hist(Y,x) where x is a vector, returns the distribution of Y amonglength(x) bins with centers specified by x. For example, if x is a 5-elementvector, hist distributes the elements of Y into five bins centered on the x-axisat the elements in x. Note: use histc if it is more natural to specify bin edgesinstead of centers.n = hist(Y,nbins) where nbins is a scalar, uses nbins number of bins.[n,xout] = hist(...) returns vectors n and xout containing the frequencycounts and the bin locations. You can use bar(xout,n) to plot the histogram.hist(...) without output arguments, hist produces a histogram plot of theoutput described above. hist distributes the bins along the x-axis between theminimum and maximum values of Y.RemarksAll elements in vector Y or in one column of matrix Y are grouped according totheir numeric range. Each group is shown as one bin.The histogram’s x-axis reflects the range of values in Y. The histogram’s y-axisshows the number of elements that fall within the groups; therefore, the y-axisranges from 0 to the greatest number of elements deposited in any bin.The histogram is created with a patch graphics object. If you want to changethe color of the graph, you can set patch properties. See the “Example” sectionfor more information. By default, the graph color is controlled by the currentcolormap, which maps the bin color to the first color in the colormap.2-222