pdf_plotting_arrays¶
-
minkit.pdf_plotting_arrays(pdf, data_values, edges, range='full', component=None, projection=None, size=1000)[source]¶ Scale the PDF values given the data values that have already been plotted using a defined set of edges.
Parameters: - pdf (PDF) – PDF to work with.
- data_values (numpy.ndarray) – data points to use for normalization
- edges (numpy.ndarray or tuple(numpy.ndarray, ..)) – bounds of the bins
- range (str) – normalization range.
- component (str or None) – if provided, then pdf is assumed to be a
AddPDFsclass, and the values associated to the given component will be calculated. - projection (str or None) – calculate the projection on a given variable.
- size (int) – number of points to evaluate. If the range is disjoint, then this size corresponds to the number of points per subrange.
Returns: Normalized values of the PDF and tuple with the centers in each dimension. In the 1D case, the array of centers is directly returned. If the range is disjoint, the result is a tuple of the previously mentioned quantities, one per subrange.
Return type: numpy.ndarray or tuple(numpy.ndarray, ..), numpy.ndarray
Raises: RuntimeError – If the number of data parameters is greater than one and no projection is specified.
Note
The input edges must be consistent with the range for plotting.