Bins
public struct Bins : Encodable
Note
Used byHistogram<XData, YData>.xBins, Histogram<XData, YData>.yBins, Histogram2D<XData,
YData, ZData>.xBins, Histogram2D<XData, YData, ZData>.yBins, Histogram2DContour<XData,
YData, ZData>.xBins, Histogram2DContour<XData, YData, ZData>.yBins.
-
Sets the starting value for the x axis bins.
Defaults to the minimum data value, shifted down if necessary to make nice round values and to remove ambiguous bin edges. For example, if most of the data is integers we shift the bin edges 0.5 down, so a
sizeof 5 would have a defaultstartof -0.5, so it is clear that 0-4 are in the first bin, 5-9 in the second, but continuous data gets a start of 0 and bins [0,5), [5,10) etc. Dates behave similarly, andstartshould be a date string. For category data,startis based on the category serial numbers, and defaults to -0.5. If multiple non-overlaying histograms share a subplot, the first explicitstartis used exactly and all others are shifted down (if necessary) to differ from that one by an integer number of bins.Declaration
Swift
public var start: Anything? -
Sets the end value for the x axis bins.
The last bin may not end exactly at this value, we increment the bin edge by
sizefromstartuntil we reach or exceedend. Defaults to the maximum data value. Likestart, for dates use a date string, and for category dataendis based on the category serial numbers.Declaration
Swift
public var end: Anything? -
Sets the size of each x axis bin.
Default behavior: If
nbinsxis 0 or omitted, we choose a nice round bin size such that the number of bins is about the same as the typical number of samples in each bin. Ifnbinsxis provided, we choose a nice round bin size giving no more than that many bins. For date data, use milliseconds or Mfor months, as in axis.dtick. For category data, the number of categories to bin together (always defaults to 1). If multiple non-overlaying histograms share a subplot, the first explicitsizeis used and all others discarded. If nosizeis provided,the sample data from all traces is combined to determinesizeas described above.Declaration
Swift
public var size: Anything?
View on GitHub
Install in Dash
Bins Structure Reference