graphinglib.Histogram.copy_with#

Histogram.copy_with(**kwargs) Self#

Returns a deep copy of the Plottable with specified attributes overridden. This is useful when multiple properties need to be changed in copies of Plottable objects, as it allows to modify the attributes in a single call.

Parameters:
**kwargs

Public writable properties to override in the copied Plottable. The keys should be property names to modify and the values are the new values for those properties.

Returns:
Self

A new instance with the specified attributes overridden.

Examples

Copy an existing Curve and change the color and line_style at the same time:

curve = Curve(x_data, y_data, color='blue')
new_curve = curve.copy_with(color='red', line_style='dashed')