polarhistogramCreate a vector of values between 0 and 2π. Create a histogram chart that shows the data sorted into six bins.
theta = [0.1 1.1 5.4 3.4 2.3 4.5 3.2 3.4 5.6 2.3 2.1 3.5 0.6 6.1]; polarhistogram(theta,6) fig2plotly()
Create a histogram plot from 100,000 values between -π and π, and sort the data into 25 bins.
theta = atan2(rand(100000,1)-0.5,2*(rand(100000,1)-0.5)); polarhistogram(theta,25); fig2plotly()
Create a histogram chart in polar coordinates, and then change its appearance. Specify the bar colors by setting the
FaceColorproperty to a character vector of a color name, such as'red', or an RGB triplet. Specify the transparency by setting theFaceAlphaproperty to a value between 0 and 1.
theta = atan2(rand(100000,1)-0.5,2*(rand(100000,1)-0.5)); polarhistogram(theta,25,'FaceColor','red','FaceAlpha',.3); fig2plotly()
Create a histogram chart in polar coordinates. Assign the histogram object to the variable
h.
theta = atan2(rand(100000,1)-0.5,2*(rand(100000,1)-0.5)); h = polarhistogram(theta,25) fig2plotly()
fig2plotly()h = Histogram with properties: Data: [100000x1 double] Values: [1x25 double] NumBins: 25 BinEdges: [1x26 double] BinWidth: 0.2513 BinLimits: [-3.1416 3.1416] Normalization: 'count' FaceColor: 'auto' EdgeColor: [0 0 0] Show all properties
Use
hto access and modify properties of the histogram object after it is created. For example, show just the histogram outline by setting theDisplayStyleproperty of the histogram object.
h.DisplayStyle = 'stairs'; fig2plotly()